Uploaded image for project: 'Struts 1'
  1. Struts 1
  2. STR-2269

<html:form> tag renders incorrect HTML 4.01 strict when using token

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.4
    • 1.2 Family
    • Tag Libraries
    • None
    • Operating System: All
      Platform: All
    • 32016

    Description

      When you are using the <html:form> tag with the transaction token, the tag
      renders the following html:

      <form name="myFormBean" method="post" action="myAction.do"><input type="hidden"
      name="org.apache.struts.taglib.html.TOKEN" value="d8fb5d4dbc6d379f9dc65d25d55d337e">
      <!-- some other stuff -->
      </form>

      When you validate such a html code against the strict doctype as in

      <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
      "http://www.w3.org/TR/html4/strict.dtd">

      you will get an error:

      Error: element INPUT not allowed here; possible cause is an inline element
      containing a block-level element

      A possible solution could be to add another attribute for the form tag like
      "strict" with values true|false which would trigger the generation of a dummy
      div-block just like

      <form ...><div><input type="hidden"...>...</div></form>

      This html would validate against the strict doctype.

      Attachments

        Activity

          People

            dsevans93 David Evans
            brianpreuss@gmx.de Brian Preuß
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: