Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Andles Jurgen
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you - I like it when the answer is so easy and i look so stupid!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic