Struts 2
  1. Struts 2
  2. WW-3429

<input> tag generated by <s:checkbox> produce HTML warning in validators

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1.8.1
    • Fix Version/s: 2.5
    • Component/s: Core Interceptors, Other
    • Environment:

      Apache Tomcat 5.5, 6.0.18 running on Win 32 and Fedora Code Linux x86_64. Actually, bug is relevant to any environment.

    • Flags:
      Patch

      Description

      <s:checkbox> tag with default xhtml theme produce an <input> tag, like that one:

      <input type="hidden" id="_checkbox_is_vacancy_open" name="_checkbox_vacancy.open" value="true" />

      produces HTML Tidy validator warning about an attribute name and ID starting with two "_" signs. So, here is a patch I suggest to resolve this issue:

      I changed FreeMarker template and a checkbox interceptor code in such a way that prefix of that input no longer produce warning.

      1. CheckboxInterceptor.java
        4 kB
        Alexey Malev
      2. checkbox.ftl
        2 kB
        Alexey Malev
      3. diff.txt
        2 kB
        Alexey Malev

        Activity

        Hide
        Alexey Malev added a comment -

        CheckboxInterceptor.java is a modified checkbox interceptor source.
        checkbox.ftl is a FreeMarker template for <s:checkbox> tag in xtml theme.

        Show
        Alexey Malev added a comment - CheckboxInterceptor.java is a modified checkbox interceptor source. checkbox.ftl is a FreeMarker template for <s:checkbox> tag in xtml theme.
        Hide
        Lukasz Lenart added a comment -

        Could you prepare a patch file? It's the eases way to implement a change!

        Thanks in advance

        Lukasz

        Show
        Lukasz Lenart added a comment - Could you prepare a patch file? It's the eases way to implement a change! Thanks in advance – Lukasz
        Hide
        Alexey Malev added a comment -

        Sure. Attached an SVN diff file for these changes. Would be nice if anyone will tell me where to find templates for this tag in other template languages, such as Velocity, if they are exist

        Show
        Alexey Malev added a comment - Sure. Attached an SVN diff file for these changes. Would be nice if anyone will tell me where to find templates for this tag in other template languages, such as Velocity, if they are exist
        Hide
        Alexey Malev added a comment -

        SVN diff for these changes

        Show
        Alexey Malev added a comment - SVN diff for these changes
        Hide
        Lukasz Lenart added a comment - - edited

        But the name attribute still contains "_" sign, shouldn't be changed to "Struts2_" ?

        Show
        Lukasz Lenart added a comment - - edited But the name attribute still contains "_" sign, shouldn't be changed to "Struts2_" ?
        Hide
        Lukasz Lenart added a comment -

        Postponed till next release

        Show
        Lukasz Lenart added a comment - Postponed till next release
        Hide
        zhouyanming added a comment - - edited

        it will break backword compatibility
        you should file a issue for html tidy validator

        Show
        zhouyanming added a comment - - edited it will break backword compatibility you should file a issue for html tidy validator
        Hide
        Lukasz Lenart added a comment -

        Moving to 2.5 as breaking change

        Show
        Lukasz Lenart added a comment - Moving to 2.5 as breaking change

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Alexey Malev
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development