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

Error with nesting tags in separate pages

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Reopened
    • Minor
    • Resolution: Unresolved
    • 1.1.0
    • 1.4.x
    • Tag Libraries
    • None
    • Operating System: other
      Platform: PC
    • 20854

    Description

      Struts RC2 & Struts Nightly Build(jakarta-struts-20030605)

      When I create a simple application, which use nested tags in 2 pages, struts
      can lose NestedReference object.
      For example if I have 2 JSP :

      test.jsp

      <%@ page language="java" %>
      <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
      <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %
      >
      <html:html>

      <head>
      </head>
      <body >
      <nested:form action='/dummy/event.do' >
      <div id="main">
      <tiles:insert page="test1.jsp"> </tiles:insert>
      </div>
      </nested:form>
      </body>

      </html:html>

      test1.jsp
      <%@ page language="java" %>
      <%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %
      >

      <table border="1">
      <tr>
      <td>First Name </td>
      <td><nested:text property="firstName"/></td>
      </tr>
      <tr>
      <td>Last Name</td>
      <td><nested:text property="lastName"/></td>
      </tr>
      <tr>
      <td>Phones</td>
      <td>
      <nested:iterate property="phones">
      <nested:text property="./"/><br/>
      </nested:iterate>
      </td>
      </tr>
      <tr>
      <td>Date </td>
      <td><nested:text property="birthDate"/></td>
      </tr>
      <tr>
      <td>Agree</td>
      <td><nested:text property="agree"/></td>
      </tr>
      </table>

      When Server start processing second jsp file, I recive "[ServletException
      in:test1.jsp] Cannot find bean in any scope'"

      if I change NestedReference.java with the following code everything work fine

      public String getNestedProperty()

      { //added line if (this.property == null) this.property ="."; return this.property; }

      Probably error are in the folowing code (NestedIterateTag)
      doStartTag()
      originalNesting = NestedPropertyHelper.getCurrentProperty(request);
      if we are in test2.jsp we can't find parent nested form and nested property
      is 'null'

      doEndTag()
      if (originalNesting == null)

      { NestedPropertyHelper.deleteReference(request); }

      else {

      the similar situatin with nested:root, nested:form tags.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              denis@extela.lv Deniss Parhomenkoo
              Votes:
              2 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: