Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts2 newbie: Custom configuration parameters

 
Eric Ases
Greenhorn
Posts: 4
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic