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

How to SET and GET session objects in Struts Action classes ???

 
Steve Adam
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Please tell me how can I SET and GET session objects in Struts Action classes ?

 
ganta gopal
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I suppose you are working on struts2.
Two ways to do

a) Make your action class to implement SessionAware interface and implement the setSession method.
b) Using ServletActionContext i,e HttpSession session = ServletActionContext.getSession();



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic