This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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!
Welcome to the JavaRanch.
Struts is an implementation of the Front Controllerpattern. 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.