restful 风格&判断是不是Ajax请求
2016-08-18 10:20
260 查看
/** * @throws ServiceException * @Title: getAllMenuByView @Description: TODO(获取菜单联动数据) @param * modelMap @return @throws */ @RequestMapping(value = "{path}/home") public String getLinkageMenu(ModelMap modelMap, HttpServletRequest request, @PathVariable("path") String path) throws ServiceException { String url = "/menu/" + path + "/home"; Map<String, Object> map = this.getLinkPage(request, url); modelMap.putAll(map); return "widget/common/layout/layout"; }
//判断是不是Ajax请求
/** * @Title: isAjaxRequest * @Description: 判断是否是ajax请求 * @param request * @return * @throws */ private boolean isAjaxRequest(final HttpServletRequest request) { if (request != null) { final String accept = request.getHeader("Accept"); if (StringUtils.isNotBlank(accept)) { if (accept.indexOf(JSON) != -1) { return true; } } } return false; }
相关文章推荐
- restful 风格&判断是不是Ajax请求
- restful 风格&判断是不是Ajax请求
- restful 风格&判断是不是Ajax请求
- Java过滤器处理Ajax请求,Java拦截器处理Ajax请求,java 判断请求是不是ajax请求
- Ajax中Put和Delete请求传递参数无效的解决方法(Restful风格)
- 如何判断一个请求是不是ajax请求
- 解决Ajax中Restful风格PUT和DELETE请求传递参数无效
- Ajax中Put和Delete请求传递参数无效的解决方法(Restful风格
- Java过滤器处理Ajax请求,Java拦截器处理Ajax请求,java 判断请求是不是ajax请求
- 资料汇总--Ajax中Put和Delete请求传递参数无效的解决方法(Restful风格)【转】
- Restful风格的springMVC配搭ajax请求的小例子
- 判断请求是不是ajax
- 如何判断请求是ajax
- PHP判断是否是AJAX请求
- php判断是否为ajax请求摘自thinkphp
- AJAX 请求区分 $_SERVER['HTTP_X_REQUESTED_WITH'] 小解
- php判断ajax请求
- Jquery&nbsp;发送ajax请求,action&nbsp;xml…
- Ruby是否是AJAX请求判断
- 如何判断浏览器的请求头是不是结束