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

Setting struts.devMode from system property not working as described

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.5.14.1
    • 6.0.0
    • Core
    • **Windows, Linux, Solaris

    Description

      According to http://struts.apache.org/core-developers/constant-configuration.html the struts.devMode setting can be read from environment strings or system properties. This works correctly when setting from an environment string - for example:

      <constant name="struts.devMode" value="${env.STRUTS_DEV_MODE:false}"/>

      However it does not work for system properties, such as setting "-DstrutsDevMode=true" as a system property and this in struts.xml:

      <constant name="struts.devMode" value="${strutsDevMode:false}"/>

      Having dug through the source I found that this is to do with the way the value substitutor is configured, and that using ":-" instead of ":" as the separator string when using system properties will work:

      <constant name="struts.devMode" value="${strutsDevMode:-false}"/>

       

      Attachments

        Issue Links

          Activity

            People

              aleksandr-m Aleksandr Mashchenko
              peterford358 Peter J Ford
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: