wood burning stoves 2.0*
The moose likes Struts and the fly likes Struts 2 session management and login Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 session management and login" Watch "Struts 2 session management and login" New topic
Author

Struts 2 session management and login

nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

I have developed a website and to allow more than one user to login I have implemented SessionListener and ContextListener.
But there are few issues with that:
1- I feel this is not the correct way as per the Struts 2 architecture, as it uses ServletContext - correct me if I'm wrong.
2- I'm unable to check whether the user is logged in.

So, what is the correct way to go about it, any references or link with examples.

Nir
jatan bhavsar
Ranch Hand

Joined: Jul 23, 2008
Posts: 296

Hi Nir,

Refer below thread which will solve your doubt. Also sessionaware interface is available which you can use.

Simple Login with session
Struts Listener

Regards
jatan
nir sharma
Ranch Hand

Joined: Sep 11, 2012
Posts: 72

hi,
I have already applied context listener. And the 'Simple login session' link work for only one user. What about multiple users?
Also how can session saved in context interact with ActionContext.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2 session management and login
 
Similar Threads
Spring security: pass additional parameter when performing login
Login action class using struts 2
Login Problem
.action redirect to .jsp to prevent double submit
application flow