This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get ServletConfig and ServletContexts in Action class of struts  RSS feed

 
sreenivas jeenor
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

How to get ServletConfig and ServletContext in Action class of struts.

so that i can use context object to store user sessions..

Help me out..

Thank You
J Sreenivas
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class org.apache.struts.action.Action that your action class extends has a getServlet() method that returns the instance of ActionServlet that called your action. Once you have the servlet, you can get the servlet context. Example:
 
sreenivas jeenor
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks merrill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!