Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
6.1.1
Description
It would be nice to be able to reference Struts constant declaration values from within the configuration files.
For example, if you wanted to set a common value for "max file upload size", you could define a constant and reference it in multiple locations from within struts.xml (or any included xml configuration file)
[struts.xml]
<struts>
<!-- Custom Constant Declarations -->
<constant name="my.constant.maxFileSize" value="20971520"/> <!-- Max size for individual files (20 MB) -->
<package>
<action name="ActionName" class="com.my.action.class.ActionName">
<interceptor-ref name="myFileUploadStack">
<!-- REFERENCE CONSTANT HERE -->
<param name="fileUpload.maximumSize">${my.constant.maxFileSize}</param>
</interceptor-ref>
</action>
</package>
</struts>