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

Issue with Struts2 Request Parameters after update to Struts 2.3.29

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.3.28, 2.3.29, 2.3.30
    • 2.3.28
    • Value Stack
    • None

    Description

      Hello Struts Team,

      we updated from Struts 2.3.24.x to 2.3.29.

      We realized that we got some problems with parameters getting set into our Java actions. We are using Lombok to create getters and setters.
      Example:

        @Getter
        @Setter
        private String sSearch_contentTypeId;
      

      This results in a generated setter name "setSSearch_contentTypeId".
      With the Struts Version below 2.3.28, which used OGNL 3.0.6 this was no problem. With the latest Version of OGNL, 3.0.17, included since 2.3.28 of Struts, this setter is no longer found.

      Reason for this is a change within the OGNL Code in "OgnlRuntime.java".

      Old Line 1774:

      String baseName = Character.toUpperCase(propertyName.charAt(0)) + propertyName.substring(1);
      

      New Line 1871:

      String baseName = capitalizeBeanPropertyName(propertyName);
      

      This new functions handles thinks completely different cause if first char is lowercase and second char is uppercase it does not modfiy it.
      Resulting in a not found setter.

      Is this an intended change so that parameters are no longer allowed to be first letter lowercase, second letter uppercase?

      Greetings Marco C.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Infineon Marco Czollmann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: