aspose file tools*
The moose likes Struts and the fly likes Struts: how to pass init params Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts: how to pass init params" Watch "Struts: how to pass init params" New topic
Author

Struts: how to pass init params

Michael Sweeney
Greenhorn

Joined: Nov 01, 2004
Posts: 5
Now that everything's running nicely under ActionServlet, how does one pass a simple init param to the execute() in an Action extension ?


mesas
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60071
    
  65

More appropriate for the Struts forum. Moved.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The Action class which you are extending has a getServlet() method that allows you to get a reference to the ActionServlet instance. From there, you can get an init parameter in the same way you would with any servlet (getServletConfig().getInitParameter("xyz")).


Merrill
Consultant, Sima Solutions
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
I have to admit that I do not know what you are asking. Action extension? A class derived from Action or maybe you are talking about a custom class derived from ActionMapping???

- Brent
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts: how to pass init params
 
Similar Threads
Initializing the jsp query
Writting to a local file
Can i write a constructor in my servlet
init methods of Servlets: need clarification
Multipe values to a init param of servlet in web.xml