Struts 1
  1. Struts 1
  2. STR-2919

Display problem with html page in <jsp:include> and wrapped in a <tiles:insert>

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.9
    • Fix Version/s: None
    • Component/s: Tiles 1 Plugin
    • Labels:
      None
    • Environment:
      Solaris 10, SuSE Enterpise Linux 10, Sun Java Web Server 6 .1 sp6

      Description

      main.jsp >>

      <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
      <html>
      <head></head>
      <body>
      <tiles:insert page="/tiles_base.jsp" flush="false">
      <tiles:put name="text" type="string">
      <jsp:include page="/jsp_include.html"/>
      </tiles:put>
      </tiles:insert>
      </body>
      </html>

      >>>>>>>>>>>>>>

      tiles_base.jsp >>

      <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
      This is the tiles base page<br>
      <tiles:insert attribute="text" ignore="false"/>

      >>>>>>>>>>>>>>

      jsp_include.html >>

      This is the jsp include page<br>

      >>>>>>>>>>>>>>

      This displays incorrectly as

      This is the jsp include page<br>
      <html>
      <head></head>
      <body>
      This is the tiles base page<br>
      </body>
      </html>

      When the jsp:include should be after the first message, and inside the <body> tag. If the page's extension is changed to jsp instead of html and included, it works fine.

        Activity

        Hide
        Daniel Bittner added a comment -

        I am experiencing a similar issue in Struts 1.1
        I am using the same wrapping techique, but I have put the ccode from the included jsp page directly into the body of the tiles:put tag.

        Show
        Daniel Bittner added a comment - I am experiencing a similar issue in Struts 1.1 I am using the same wrapping techique, but I have put the ccode from the included jsp page directly into the body of the tiles:put tag.
        Hide
        Antonio Petrelli added a comment -

        From the JSP specification:
        http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html
        I read:
        <snip>
        The <jsp:include> element allows you to include either a static or dynamic resource in a JSP page. The results of including static and dynamic resources are quite different. If the resource is static, its content is included in the calling JSP page. If the resource is dynamic, it acts on a request and sends back a result that is included in the JSP page. When the include action is finished, the JSP container continues processing the remainder of the JSP page.
        </snip>

        IOW, if you have a HTML it should be included in the page, while if it is a JSP page it will be included in the response itself.
        It seems that the container behaves as HTML are JSPs :-O
        Anyway, I suppose this bug is related to the container, but it needs more investigation.

        Show
        Antonio Petrelli added a comment - From the JSP specification: http://java.sun.com/products/jsp/syntax/1.2/syntaxref1214.html I read: <snip> The <jsp:include> element allows you to include either a static or dynamic resource in a JSP page. The results of including static and dynamic resources are quite different. If the resource is static, its content is included in the calling JSP page. If the resource is dynamic, it acts on a request and sends back a result that is included in the JSP page. When the include action is finished, the JSP container continues processing the remainder of the JSP page. </snip> IOW, if you have a HTML it should be included in the page, while if it is a JSP page it will be included in the response itself. It seems that the container behaves as HTML are JSPs :-O Anyway, I suppose this bug is related to the container, but it needs more investigation.

          People

          • Assignee:
            Unassigned
            Reporter:
            Sean Kavanagh
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development