Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 session management and login

 
nir sharma
Ranch Hand
Posts: 72
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 299
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic