File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can I access the Application Context from a Struts 2 Action?

 
Robert Heath
Ranch Hand
Posts: 94
C++ Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have looked at the ActionSupport class and there does not appear to be any way to get to the Application Context. for objects on the Application Context. Would it be a violation of best practices to access the Application Context from an action?
 
Jesus Mireles
Ranch Hand
Posts: 122
IntelliJ IDE Java Mac
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it depends what your getting the context for ...
 
Tom Rispoli
Ranch Hand
Posts: 349
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you use the Servlet Config Interceptor you can set up an application Map that can be accessed by all of your action classes that implement ApplicationAware. The same interceptor should also allow you to implement ServletContextAware interface to give you access to the servlet context if thats what you need.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic