我有两个方法并使用 Spring MVC,首先是方法 = RequestMethod.GET,然后我设置 session.setAttribute("clientId", "abc")。第二种方法是 method=RequestMethod.POST 我这样做:
HttpSession session = request.getSession();
System.out.println("-----" + (String)session.getAttribute("clientId"));
但总是为空。
[编辑]
这里的事情是post方法不是由ModalandView(“postpage”)调用的,它是由Apache oltu内部的Http callout调用的