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

Null id is not possible on component

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.12
    • Fix Version/s: 2.3.12
    • Component/s: None
    • Labels:
      None

      Description

      When inserting a component in a JSP action result (using <s:component template=...), the component has always at least an empty String as id.

      It is impossible to have null as value for id. Even when specifying explicitly null as being the value for id.

      This is the case when using s:param or the id attribute of s:component.

      After discussing the issue with Lukasz Lenart, he pointed out that the cause of this issue is that the UIBean.escape(String) method is always called on the id and that it returns an empty String when a null String is passed to it.

      This issue should be fixed or documented. Current documentation for id says it has no default value.

      There is a poc project. It was shared on the mailing list under the title
      "Re: Inconsistency in Struts2 s:component parameters handling".

      A copy of the poc has been uploaded here as well.

      Feel free to ask more questions.

      Best regards,
      Thim.

        Attachments

        1. playground.zip
          8 kB
          Thim Anneessens

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              t.anneessens Thim Anneessens
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1m
                1m
                Remaining:
                Remaining Estimate - 1m
                1m
                Logged:
                Time Spent - Not Specified
                Not Specified