Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Spring MVC setting session variables...

utkarshakutkarshak Member Posts: 1
Hi
We are implementing a project in Spring MVC.I have assumed the logic for the sessions had to be written in the Controller classes instead of jsp pages in order to be able to manipulate the "model". So i tried putting:

request.setAttribute("sessionUserid",user.getUserid());

in the Login Controller and:
request.getAttribute("sessionUserid");

in the next Controller which shows the success view. Both the Controller's onSubmit() methods have HttpServlet request and response objects as parameters.

Simultaneously, in the Dispatcher-servlet, i set the session "true" as follows:


true
login
net.rms.loginClasses.Login


login
custHome


Inspite of all this, its showing the "sessionUserid" as null in the second Controller class (by SOPL). Please let me know what other changes should be made for it to work. Help greatly appreciated.

Thank you!
Sign In or Register to comment.