日期:2014-05-19 浏览次数:20788 次
public ActionForward uploadPic(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //这里的request是MultipartRequestWrapper request.getSession().setAttribute(key, value); // 打印sessionid System.out.println("sessionid:" + ((MultipartRequestWrapper) request).getRequest().getRequestedSessionId()); System.out.println("sessionid:" + request.getRequestedSessionId()); return null; }
public ActionForward test(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { // 这里的request是RequestFacade 得不到上面session里面的值 request.getSession().getAttribute(key); // 打印sessionid System.out.println("sessionid:" + request.getRequestedSessionId()); return null; }