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

%{id} evaluates different for data-* and value attribute

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.5.26
    • 2.5.29, 6.0.0
    • None
    • None

    Description

      %{id} evaluates for "data-*" attributes in a different way than for the "value" attribute.

      in a very simple context where I have only one getter:

      public Long getId() {
         return 27357L;
      }
      

      The following two usages of "id" in one tag in a jsp evaluates in different ways:

      JSP:

      <%@ taglib prefix="s" uri="/struts-tags"%>
      <s:hidden name="first" data-wuffmiauww="%{id}" id="einszwei" value="%{id}"/>
      <s:hidden name="second" data-wuffmiauww="%{id}" value="%{id}"/>
      

      Result:

      <input type="hidden" name="first" value="27357" id="einszwei" data-wuffmiauww="einszwei">
      <input type="hidden" name="second" value="27357" data-wuffmiauww>
      

      I expect the Id of my getter - for both cases.
      The value for data-wuffmiauww is wrong.

      With struts2 version 2.5.20 the result was correct:

      <input type="hidden" name="first" value="27357" id="einszwei" data-wuffmiauww="27357">
      <input type="hidden" name="second" value="27357" data-wuffmiauww="27357">
      

      Attachments

        Issue Links

          Activity

            People

              lukaszlenart Lukasz Lenart
              j.marczona Jonas Marczona
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 7h 50m
                  7h 50m