tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zbigniew Reszela <132...@student.pwr.wroc.pl>
Subject Re: example from tutorial
Date Tue, 19 Feb 2008 18:20:13 GMT
I changed it as You said but it still doesn't work.
These are my files:
web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app>

<servlet>
    <servlet-name>tiles</servlet-name>
    <servlet-class>org.apache.tiles.servlet.TilesServlet</servlet-class>
    <init-param>
        <param-name>org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG</param-name>
        <param-value>/WEB-INF/tiles-defs.xml</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
</servlet>

</web-app>

tiles-defs.xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
       "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
       "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="myapp.homepage" template="/layouts/classic.jsp">
  <put-attribute name="title" value="Tiles tutorial homepage" />
  <put-attribute name="header" value="/tiles/banner.jsp" />
  <put-attribute name="menu" value="/tiles/common_menu.jsp" />
  <put-attribute name="body" value="/tiles/home_body.jsp" />
  <put-attribute name="footer" value="/tiles/credits.jsp" />
</definition>
</tiles-definitions>

classic.jsp:

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<html>
  <head>
    <title><tiles:getAsString name="title"/></title>
  </head>
  <body>
        <table>
      <tr>
        <td colspan="2">
          <tiles:insertAttribute name="header" />
        </td>
      </tr>
      <tr>
        <td>
          <tiles:insertAttribute name="menu" />
        </td>
        <td>
          <tiles:insertAttribute name="body" />
        </td>
      </tr>
      <tr>
        <td colspan="2">
          <tiles:insertAttribute name="footer" />
        </td>
      </tr>
    </table>
  </body>
</html>

And my starting page - index.jsp:

<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<tiles:insertDefinition name="myapp.homepage" />

I have written also files "/tiles/banner.jsp", "/tiles/common_menu.jsp", "/tiles/home_body.jsp",
"/tiles/credits.jsp".

The result is blank page and on tomcat:

Mar 19, 2008 6:07:48 PM org.apache.tiles.jsp.taglib.RenderTagSupport doCatch
SEVERE: Error during rendering
javax.servlet.jsp.JspException: TilesContainer not initialized
        at org.apache.tiles.jsp.taglib.ContainerTagSupport.doStartTag(ContainerT
agSupport.java:72)
        at org.apache.tiles.jsp.taglib.RenderTagSupport.doStartTag(RenderTagSupp
ort.java:146)
        at org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(
index_jsp.java:85)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:59)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:393)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
20)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:263)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:584)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
        at java.lang.Thread.run(Thread.java:619)
Mar 19, 2008 6:07:50 PM org.apache.tiles.jsp.taglib.RenderTagSupport doCatch
SEVERE: Error during rendering
javax.servlet.jsp.JspException: TilesContainer not initialized
        at org.apache.tiles.jsp.taglib.ContainerTagSupport.doStartTag(ContainerT
agSupport.java:72)
        at org.apache.tiles.jsp.taglib.RenderTagSupport.doStartTag(RenderTagSupp
ort.java:146)
        at org.apache.jsp.index_jsp._jspx_meth_tiles_005finsertDefinition_005f0(
index_jsp.java:85)
        at org.apache.jsp.index_jsp._jspService(index_jsp.java:59)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:393)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
20)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:263)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:584)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
        at java.lang.Thread.run(Thread.java:619)

Thanks a lot for help.






Mime
View raw message