How do you get a Struts2 value from the .properties file programatically?

Josh picture Josh · Apr 2, 2009 · Viewed 32.8k times · Source

Say I have a struts.properties file with a defined value uploads.directory . How can I access that value from an Actioncontext programatically?

Answer

Roy Chan picture Roy Chan · May 6, 2009

You can use getText("some.property.name") which return you the property value

http://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ActionSupport.html