[ 
https://issues.apache.org/struts/browse/TILES-239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Antonio Petrelli closed TILES-239.
----------------------------------


> JSP Segments (*.jspf) Are Being Included Statically And Not Compiled
> --------------------------------------------------------------------
>
>                 Key: TILES-239
>                 URL: https://issues.apache.org/struts/browse/TILES-239
>             Project: Tiles
>          Issue Type: Bug
>          Components: tiles-jsp (jsp support)
>    Affects Versions: 2.0.5
>         Environment: Windows XP
> Tomcat 5.5
>            Reporter: Lee Theobald
>            Assignee: Antonio Petrelli
>            Priority: Minor
>         Attachments: header.jspf, index.jsp, screenshot.png, template.jsp, 
> TilesTest.war
>
>
> Discussion of this issue started over on the user groups at: 
> http://www.nabble.com/-Tiles-2-Standalone--Where-are-my-JSTL-EL-variables--td15021180.html
> When I include a JSP segment (with a .jspf extension) in my template any 
> code, includes etc. are printed out to the screen as is and not compiled.  
> For example.  Imagine I had a web application called "test" with the 
> following folder structure:
> test
> + index.jsp
> +--+ includes
> |    + header.jspf
> |    +  main.jspf
> |
> +--+ templates
>      + template.jsp
> The main files containing the following code:
> INDEX.JSP
> --------------------
> <%@ taglib uri="http://tiles.apache.org/tags-tiles"; prefix="tiles" %>
> <tiles:insertTemplate template="templates/template.jsp">
>       <tiles:putAttribute name="pageTitle" value="Hello world!" />
>       <tiles:putAttribute name="header" type="template" 
> value="../includes/header.jspf" />
>       <tiles:putAttribute name="main" type="template" 
> value="../includes/main.jspf" />
> </tiles:insertTemplate>
> TEMPLATE.JSP
> -------------------------
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
> <%@ taglib uri="http://tiles.apache.org/tags-tiles"; prefix="tiles" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions"; prefix="fn" %>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
> <title><tiles:getAsString name="pageTitle" ignore="true"/></title>
> </head>
> <body>
> <div id="pagewrap">
>       <div id="header">
>               <tiles:insertAttribute name="header" />
>       </div>
>       <div id="main">
>               <tiles:insertAttribute name="main" />
>       </div>
> </div>
> </body>
> </html>
> HEADER.JSPF
> -----------------------
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt"; prefix="fmt" %>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions"; prefix="fn" %>
> <h1>HEADER</h1>
> <% String a123 = "hello"; %>
> <c:set var="test" value="Wibble"/>
> <p>Test = <c:out value="${test}"/></p>
> <h3>Params</h3>
> <dl id="requestvars" style="display:none;">
>       <c:forEach var='parameter' items='${paramValues}'>
>         <dt>${parameter.key}</dt>
>         <c:choose>
>           <c:when test="${empty parameter.value[0]}">
>             <dd>&nbsp;</dd>
>           </c:when>
>           <c:otherwise>
>             <dd>${parameter.value[0]}</dd>
>           </c:otherwise>
>         </c:choose>
>       </c:forEach>
> </dl>
> Main.jspf just contains the text "Hello World"
> Upon accessing index.jsp I see the page laid out as I expect it but the 
> content of the header portion is incorrect.  My code is printed out to the 
> screen.  So I can see my taglib declerations on the screen and if I view the 
> source, all my core tags are still in the HTML.  If rename the includes from 
> .jspf to .jsp and change index.jsp accordingly, all is fine.
> Shouldn't the .jspf files also be compiled?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to