Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5066

Allow references to struts constants from within the same (or included) XML configuration files.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • Future
    • 2.6.1
    • XML Configuration

    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>

      Attachments

        Activity

          People

            Unassigned Unassigned
            burtonrhodes Burton Rhodes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: