15,000 Jobs Available in:
Java, ASP, C#, PHP, SQL, SAP, MySQL and many more.
- Class Quick -
The moose likes Spring and the fly likes Regarding retrieving of session information Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Application Frameworks » Spring
Reply Bookmark "Regarding retrieving of session information" Watch "Regarding retrieving of session information" New topic
Author

Regarding retrieving of session information

yekkala krishna
Ranch Hand

Joined: Mar 04, 2007
Posts: 105
Hi,

In my application we are using servlets and spring MVC technologies.

In Spring Controller class i am setting attributes for a session in the below manner:

req.getSession().setAttribute("GSAM_USER_ID", enteredUser);

And in our servlet if i retrieving this attribute in the below manner:
String userId =(String) session.getAttribute("GSAM_USER_ID");

It getting userId as null.could you please suggest why it's retrieving as null.

Thanks in advance.

regards,
rama
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 365

Are you sure, your spring controller class is excecuted, before calling the servlet... Also, can you please tell us how you are getting your session in the servlet..

P.S: when you are using spring MVC, i don't know, why you are going for servlets...


Regards, Prasad
SCJP 5 (93%)
 
 
subject: Regarding retrieving of session information
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com