tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Baptiste GAILLARD <baptiste.gaill...@gmail.com>
Subject Strange problem while trying to access a tiles 404 error page
Date Sat, 27 Oct 2007 14:56:33 GMT
Hi, I have a very strange problem, I've defined a 404 error page.

-- -- -- web.xml -- -- --
<error-page>
    <error-code>404</error-code>
    <location>/pages/errors/page404.jsp</location>
</error-page>


-- -- -- /pages/errors/page404.jsp -- -- --
<?xml version="1.0" encoding="UTF-8"?>

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

<tiles:insertDefinition name="errors.404" />


-- -- -- /pages/errors/errors.tiles.xml -- -- --
<?xml version="1.0" encoding="UTF-8" ?>

<!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>

        <!-- 404 error page -->
        <definition name="errors.404" extends="public.pageLayout">
                <put-attribute name="public.pageLayout.content" 
value="/pages/errors/404.jsp" />
        </definition>

</tiles-definitions>

In /pages/errors/404.jsp there is only a line of text.
When I enter a bad address I need to be redirected to my 404 error page, 
but a strange exception appear (not complete):
 
16:40:31,771 INFO  [STDOUT] 16:40:31,770 ERROR [RenderTagSupport] Error 
during rendering
javax.servlet.jsp.JspException: Error executing tag: JSPException while 
including path '/pages/public/pageLayout/pageLayout.jsp'. 
ServletException while including page.
        at 
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:80)
        at 
org.apache.tiles.jsp.taglib.ContainerTagSupport.doEndTag(ContainerTagSupport.java:80)
        at 
org.apache.jsp.pages.errors.page404_jsp._jspx_meth_tiles_005finsertDefinition_005f0(page404_jsp.java:89)
        at 
org.apache.jsp.pages.errors.page404_jsp._jspService(page404_jsp.java:61)
        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:387)
        at 
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
        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(ApplicationFilterChain.java:290)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at 
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:687)
        at 
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)
        at 
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)
        at 
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
        at 
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:424)
        at 
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:343)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:144)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
        at 
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:580)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:613)
Caused by: org.apache.tiles.TilesException: JSPException while including 
path '/pages/public/pageLayout/pageLayout.jsp'. ServletException while 
including page.
        at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:425)
        at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:368)
        at 
org.apache.tiles.jsp.taglib.InsertDefinitionTag.render(InsertDefinitionTag.java:63)
        at 
org.apache.tiles.jsp.taglib.RenderTagSupport.execute(RenderTagSupport.java:171)
        at 
org.apache.tiles.jsp.taglib.RoleSecurityTagSupport.doEndTag(RoleSecurityTagSupport.java:75)
        ... 26 more
Caused by: java.io.IOException: JSPException while including path 
'/pages/public/pageLayout/pageLayout.jsp'. ServletException while 
including page.
        at 
org.apache.tiles.jsp.context.JspTilesRequestContext.include(JspTilesRequestContext.java:91)
        at 
org.apache.tiles.jsp.context.JspTilesRequestContext.dispatch(JspTilesRequestContext.java:82)
        at 
org.apache.tiles.context.TilesRequestContextWrapper.dispatch(TilesRequestContextWrapper.java:72)
        at 
org.apache.struts2.tiles.StrutsTilesRequestContext.dispatch(StrutsTilesRequestContext.java:86)
        at 
org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:417)
        ... 30 more

Ok, the error comes from /pages/public/pageLayout/pageLayout.jsp which 
correspond to the "public.pageLayout" definition extended to build the 
"errors.404" one definition.
But if I try to manually enter the address of page404.jsp 
(/pages/errors/page404.jsp) as definied in web.xml or 
'/errors.404.tiles' in my web browser everything works !
So I do not understand why the correct redirection doens't work with a 
bad address. I've tried to replace /pages/errors/pages404.jsp in web.xml 
with a simple HTML file and the redirection perfectly works. The problem 
appear when my 404 error page contains tiles definitions.

Do you know how to solve this problem ?

Thanks,


Baptiste Gaillard

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message