Search code examples
propertiesstruts2actioncontext

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


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


Solution

  • 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