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 getting stuff out of action classes and into the application scope of a jsp? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "getting stuff out of action classes and into the application scope of a jsp?" Watch "getting stuff out of action classes and into the application scope of a jsp?" New topic
Author

getting stuff out of action classes and into the application scope of a jsp?

Andles Jurgen
Ranch Hand

Joined: Mar 18, 2002
Posts: 67
I can access the request scope via an action class - but what about application scope? I am presently using an action that binds an object to request scope and the forward jsp then places it into application scope - this is messy and problematic.
Would I create a singlton class to use as a kind of repository for applicaton scope, and just use it to put stuff in via my action classes (or business methods used by action classes)
Am I missing something here?
Andy
Tzanko Stefanov
Greenhorn

Joined: Nov 14, 2003
Posts: 4
I am not sure whether this is what are you trying to do, but if you want to access the Context from an Action class you can do that with:
getServlet().getServletContext()
Then you can set and get Attributes in the application context.
Andles Jurgen
Ranch Hand

Joined: Mar 18, 2002
Posts: 67
Thank you - I like it when the answer is so easy and i look so stupid!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: getting stuff out of action classes and into the application scope of a jsp?