You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Burton Rhodes (Jira)" <ji...@apache.org> on 2020/04/10 13:50:00 UTC

[jira] [Updated] (WW-5066) Allow references to struts constants from within the same (or included) XML configuration files.

     [ https://issues.apache.org/jira/browse/WW-5066?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Burton Rhodes updated WW-5066:
------------------------------
    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>

  was:
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>


> Allow references to struts constants from within the same (or included) XML configuration files.
> ------------------------------------------------------------------------------------------------
>
>                 Key: WW-5066
>                 URL: https://issues.apache.org/jira/browse/WW-5066
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: XML Configuration
>    Affects Versions: Future
>            Reporter: Burton Rhodes
>            Priority: Minor
>              Labels: features
>
> 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>



--
This message was sent by Atlassian Jira
(v8.3.4#803005)