This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2 session management

 
Dheeraj Singh Thakur
Greenhorn
Posts: 4
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am developing a site in which i have to implement session listener.
As i have HttpSessonListener for this but i want to know is there any equivalent struts 2 api for this.

Thanks in advance
 
Joe Ess
Bartender
Pie
Posts: 9258
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpSessonListener is in the JEE API, not Struts (1 or 2).
 
Dheeraj Singh Thakur
Greenhorn
Posts: 4
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my question. We have HttpSessionListener in JEE...Do we have anything like this for struts.??
 
E Armitage
Rancher
Posts: 989
9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dheeraj Singh Thakur wrote:This is my question. We have HttpSessionListener in JEE...Do we have anything like this for struts.??

Why would struts have the same functionality again? Struts is not a replacement of JEE APIs. Is there a reason why you don't want to implement the JEE HttpSessionListener?
 
Dheeraj Singh Thakur
Greenhorn
Posts: 4
Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam using SessionAware for session management and i want to configure HttpSessionListener but its not working with SessionAware means sessionCreated method is not called when new session object is being created using SessionAware.
 
E Armitage
Rancher
Posts: 989
9
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dheeraj Singh Thakur wrote:Iam using SessionAware for session management and i want to configure HttpSessionListener but its not working with SessionAware means sessionCreated method is not called when new session object is being created using SessionAware.


SessionAware does not create new sessions. If you want to listen for session attribute changes then you must implement HttpSessionAttributeListener. HttpSessionListener.sessionCreated is only fired once when the user session is created.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic