File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Difference between ActionContext.getContext().getSession() and HttpSession Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Difference between ActionContext.getContext().getSession() and HttpSession" Watch "Difference between ActionContext.getContext().getSession() and HttpSession" New topic
Author

Difference between ActionContext.getContext().getSession() and HttpSession

Dev Anand
Ranch Hand

Joined: Aug 30, 2009
Posts: 41
What is the difference between ActionContext.getContext().getSession() and HttpSession?
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

No difference, Struts 2 internally uses Servlets and session ActionContext is implements using ThreadLocal so we can access session from ActionContext but we should use SessionAware interface to get session object.


ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Dev Anand
Ranch Hand

Joined: Aug 30, 2009
Posts: 41
can we set session timeout in ActionContext.getContext().getSession()?
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

just configure it in web.xml file

for more details refer the following link. SettingSessionTimeOut
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference between ActionContext.getContext().getSession() and HttpSession