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

JavaScript errors due to hyphens in action names

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.11.2
    • 2.3.1
    • None
    • None

    Description

      Action names may include some characters (such as hyphens) that cannot be part of a JavaScript variable name.
      In form related tags, the action name is used as a part of the generated HTML tag name and/or id.

      This causes invalid JavaScript when a HTML tag name/id is used as part of a JavaScript variable, such as in <s:doubleselect> generated JavaScript (an, I think, also in JavaScript validation code, but I'm not sure).

      A simple fix would be replacing all prohibited characters with underscores in the generated HTML tags names and ids.

      Attachments

        1. fix-doubleselect-for-ids-containing-non-id-chars.patch
          7 kB
          Juan Jesús García de Soria Lucena
        2. fix-doubleselect-for-ids-containing-non-id-chars-v2.patch
          7 kB
          Juan Jesús García de Soria Lucena

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mdiaz Miguel Diaz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: