This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts2: Different ways to use session Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Struts2: Different ways to use session" Watch "Struts2: Different ways to use session" New topic
Author

Struts2: Different ways to use session

Paul Michael Serrano
Ranch Hand

Joined: Nov 22, 2004
Posts: 59

I am trying to save objects into session. May I know what are the differences of using

SessionAware (implementing into the class)

and

Map session = ActionContext.getContext().getSession(); --> adding this line of code into the class

Paul
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

One is recommended (implementing SessionAware), the other one works (using ActionContext).
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Struts2: Different ways to use session
 
Similar Threads
Spring MVC controller Form
MK Notes and EJB in Action doubts
Business Logic in EJB3 SessionBean?
inner class
View cannot be restored exception