This week's giveaway is in the Groovy forum.
We're giving away four copies of Groovy Fundamentals video training course and have Ken Kousen on-line!
See this thread for details.
The moose likes Struts and the fly likes How to SET and GET session objects in Struts Action classes ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Groovy Fundamentals video training course this week in the Groovy forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to SET and GET session objects in Struts Action classes ???" Watch "How to SET and GET session objects in Struts Action classes ???" New topic
Author

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

Steve Adam
Ranch Hand

Joined: Jan 07, 2009
Posts: 40
Hi
Please tell me how can I SET and GET session objects in Struts Action classes ?


Its not what you do, its how well you do it.
ganta gopal
Greenhorn

Joined: Feb 05, 2009
Posts: 15
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();



 
wood burning stoves
 
subject: How to SET and GET session objects in Struts Action classes ???