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 Struts2 newbie: Custom configuration parameters Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 newbie: Custom configuration parameters" Watch "Struts2 newbie: Custom configuration parameters" New topic
Author

Struts2 newbie: Custom configuration parameters

Eric Ases
Greenhorn

Joined: Nov 17, 2010
Posts: 4

Hello, I have just started with Struts2, and am trying to pass in custom parameters to my app. This includes mostly text strings like the site name, special email addresses, directories, various flags that are used in the app, etc, so that it can be easily changed out. In my current non-Struts system, I have them in an XML file that I read in on startup with a custom file reader. Is there a way to pass in custom information like this in a Struts way?

I have searched around, but all of the examples I've seen relate to Struts-specific parameters that can be setup via struts.xml or other property files. Thanks!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8708
    
    6

Welcome to the JavaRanch.
Struts is an implementation of the Front Controller pattern. It doesn't care about how you configure your application.
The "servlet" way to do it would probably be to use servlet parameters. If you have many parameters and don't want to pollute web.xml, using properties files or the XML strategy you've used before is fine.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts2 newbie: Custom configuration parameters
 
Similar Threads
Struts2 with RAD7
Passing a bean:message as string to a custom tag?(Struts2)
Struts2 problem with ModelDriven interceptor
struts2: how to set parameter?
Struts2 with RAD7