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

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.3.16.3
    • 7.0.0
    • Core Actions
    • 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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned
            pbenedict Paul Benedict

            Dates

              Created:
              Updated:

              Slack

                Issue deployment