@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"; }
时间: 2024-12-28 17:47:00