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

Accessing static variable via OGNL returns nothing

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.5.20
    • Fix Version/s: 2.5.22, 2.6
    • Component/s: None
    • Labels:
      None

      Description

      Accessing static variables of a public class does not seem to work. I tried setting the struts.ognl.allowStaticMethodAccess = true in the project root's struts.properties but it didn't change anything.

      <s:property value="@de.mytest.common.Constants@CONSTANT" default="Nothing" />
      

      For this, I get "Nothing" as the output. It seems to have worked in 2.5.18.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                k918912 k918912
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: