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

Form @id and @name are not actually unique

Attach filesAttach ScreenshotAdd voteVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.3.16.3
    • Fix Version/s: 2.5.x
    • Component/s: Core Actions
    • Labels:
      None

      Description

      I am placing a form to the same action multiple time each with different hidden attributes:

      <s:form action="myAction">
        <s:hidden name="enabled" value="true"/>
        <s:submit value="Enable" />
      </s:form>
      <s:form action="myAction">
        <s:hidden name="enabled" value="false"/>
        <s:submit value="Disable" />
      </s:form>
      

      Conceptually there should be no problem with this. However, the form's @id and @name attributes are not rendered unique. Struts should use a global counter to append a counter to the names of each attribute automatically. If the user wants to override these attributes explicitly, that should be allowed.

        Attachments

        Issue Links

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pbenedict Paul Benedict

              Dates

              • Created:
                Updated:

                Issue deployment