获得request对象
Posted unique1319
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获得request对象相关的知识,希望对你有一定的参考价值。
@RequestMapping("/navQueryMap") public String navQueryMap(@RequestParam(value="queryOrigin",required=false) String queryOrigin, @RequestParam(value="queryDestination",required=false) String queryDestination, @RequestParam(value="queryStartTime",required=false) String queryStartTime, @RequestParam(value="queryEndTime",required=false) String queryEndTime) { /*在一个普通类中获得 HttpServletRequest 对象*/ HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); HttpSession session = request.getSession(); session.setAttribute("queryOrigin", queryOrigin); session.setAttribute("queryDestination", queryDestination); session.setAttribute("queryStartTime", queryStartTime); session.setAttribute("queryEndTime", queryEndTime); return "navQueryMap"; }
以上是关于获得request对象的主要内容,如果未能解决你的问题,请参考以下文章
JAVA-JSP内置对象之request获得封装所有参数值的Map
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法(转)(代码片段
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE的解决办法(转)(代码片段