0

I have tow method and using Spring MVC, first is a method=RequestMethod.GET and there I set session.setAttribute("clientId", "abc"). Second method is a method=RequestMethod.POST where I do this:

HttpSession session = request.getSession();
System.out.println("-----" + (String)session.getAttribute("clientId"));

But always get null.

[Edit]

The thing here is the post method is not called by ModalandView("postpage"), its called by Http callout by Apache oltu internally

user614946
  • 599
  • 5
  • 10
  • 27

1 Answers1

0

In Get method do

 Session session = request.getSession(true); 
  session.setAttribute("clientId", "abc");

In Post do

String s = request.getSession().getAttribute("clientId");
VolBog
  • 13
  • 3
  • tried it but it didn't worked for me, the thing here is the post method is not called by ModalandView("postpage"), its called by Http callout by Apache oltu internally. – user614946 Sep 07 '16 at 06:01