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

<nested:iterate> loses index with jsp:include

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 1.1.0
    • Future
    • Tag Libraries
    • None
    • Operating System: Windows XP
      Platform: PC
    • 17977

    Description

      POTENTIAL BUG:
      When using nested:interate and placing a jsp:include in the iteration, the
      included jsp cannot retrieve the proper nesting level. Thus any form related
      nested tags are possibly named with duplicate names. ie:

      <input hidden="name[0]" value="name1"/>
      <input hidden="name[0]" value="name2"/>

      COMMENT OF NOTE:
      It appears that tag does NOT lose the actual underlying beans,
      it just loses the proper naming of the index.

      SIMPLE EXAMPLE:

          • testNestedIterate.jsp =
            <nested:root name="narray">
            <nested:iterate property="names">
            BEFORE: <nested:writeNesting /><br />
            <jsp:include page="testNestedIterateInclude.jsp" />
            </nested:iterate>
            </nested:root>
          • testNestedIterateInclude.jsp =
            <nested:root>
            AFTER: <nested:writeNesting />
            Name in bytes: <nested:write property="bytes"/><p />
            </nested:root>

      I will attach the test class throwaway.test.Names
      in a subsequent comment to help document this problem better.
      I've tried to seriously test this before submitting this as
      bug so if any further information is needed please reach me
      at cbutler@mateso.com.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--Names.java
          0.3 kB
          Chris Butler
        2. ASF.LICENSE.NOT.GRANTED--requestScope.jsp
          1 kB
          Chris Butler
        3. ASF.LICENSE.NOT.GRANTED--StrutsBaseForm.java
          2 kB
          Christine
        4. ASF.LICENSE.NOT.GRANTED--StrutsInnerBean.java
          1 kB
          Christine
        5. ASF.LICENSE.NOT.GRANTED--testBase.jsp
          0.4 kB
          Christine
        6. ASF.LICENSE.NOT.GRANTED--testInnerJunk.jsp
          0.2 kB
          Christine
        7. ASF.LICENSE.NOT.GRANTED--testInnerOne.jsp
          0.8 kB
          Christine
        8. ASF.LICENSE.NOT.GRANTED--testInnerTwo.jsp
          0.3 kB
          Christine
        9. ASF.LICENSE.NOT.GRANTED--testNestedIterate.jsp
          0.5 kB
          Chris Butler
        10. ASF.LICENSE.NOT.GRANTED--testNestedIterateInclude.jsp
          0.7 kB
          Chris Butler
        11. ASF.LICENSE.NOT.GRANTED--testNestedIterateInclude.jsp
          0.3 kB
          Chris Butler
        12. ASF.LICENSE.NOT.GRANTED--testNestedIterateInclude2.jsp
          0.1 kB
          Chris Butler

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cbutler@mateso.com Chris Butler
              Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: