struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg Maurer <joerg.mau...@ucpmorgen.com>
Subject RE: how to catch exception using tiles thrown by e.g. org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude
Date Tue, 04 Mar 2003 19:07:11 GMT
>> Cedric 
exactly as you said, <insert> is used. despite the big try-catch block
approach, its unclear to me why error-page in web.xml doesn#t get a try.

Additionally i searched for similar behaviour and all i found was
following 
"page 52 of the JSP 1.2 spec : 
Note: if autoFlush=true then if the contents of the initial Jsp-
Writer has been flushed to the ServletResponse output stream
then any subsequent attempt to dispatch an uncaught
exception from the offending page to an errorPage may fail.
When an error page is also indicated in the web.xml
descriptor, the JSP error page applies first, then the web.xml
page.".

You as a more experienced one than myself, does it make some sense to
the issue?

-----Original Message-----
From: Cedric Dumoulin [mailto:cedric@apache.org]
Sent: Dienstag, 04. März 2003 18:35
To: Struts Users Mailing List
Subject: Re: how to catch exception using tiles thrown by e.g.
org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude



  I suppose that your exception is thrown by a <tiles:insert ...> tag in

a jsp.
  This exception is thrown by the tiles framework, which know nothing 
about the struts exception mechanism, so it can't be used. The exception

is then propagated by the tag handler and reach the jsp page (the tile 
jsp). If there is an exception handler associated to the jsp, it is 
called, if there is no handler, the exception is propagated to parent 
page inserting this one. If the parent page have inserted the child page

with an <insert ...>, then the <insert> catch the exception and show it.

Normally, the jsp exception handling should work, but it appear that it 
is not always the case.

  A workaround is to put a big try/catch in the jsp throwing the 
exception ;-(. This will be improved in future versions.

     Cedric

Jörg Maurer wrote:

>Hi struts people!
>
>I have really defined everywhere i think i can put an exception handler
>for servlet exception : 
>1.) in my base layout.jsp an <%@
>errorPage='/pages/common/error/errorsGeneralHandler.jsp'%>
>2.) in struts config a global exception handler
>         <global-exceptions>
>          <exception 
>            path="pages/common/error/errorsGeneralHandler.jsp"
>            type="javax.servlet.ServletException"/>  
>         </global-exceptions> 
>3.) in web.xml
>  <error-page>
>    <exception-type>javax.servlet.ServletException</exception-type>
>    <location>/pages/common/error/errorsGeneralHandler.jsp</location>
>  </error-page>
>
>Still ServletException slip through my guards. Last know point as stack
>trace shows below is
>org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilS
t
>rutsModulesImpl.java:122) , which throws ServletException but is never
>catchable to me. The point is not the FileNotFound, which is pretty
>clear to me, but why such exception doesn´t hit any of my error
handler.
>
>Any hints appreciated!
>
>
>2003-03-04 12:36:06 ApplicationDispatcher[] Servlet.service() for
>servlet jsp threw exception
>javax.servlet.ServletException: /pages/wf_category/pager_region.jsp
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.service(IDEJspServlet.java:183)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi
l
>e(IDEJspServlet.java:246)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ
s
>pServlet.java:339)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:683)
>        at
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
p
>atcher.java:574)
>        at
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
t
>cher.java:497)
>        at
>org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.j
a
>va:819)
>        at
>org.apache.jsp.wf_0005fcategory_0005fchoose$jsp._jspService(wf_0005fcat
e
>gory_0005fchoose$jsp.java:107)
>        at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.service(IDEJspServlet.java:173)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi
l
>e(IDEJspServlet.java:246)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ
s
>pServlet.java:339)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:683)
>        at
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
p
>atcher.java:574)
>        at
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
t
>cher.java:497)
>        at
>org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilS
t
>rutsModulesImpl.java:122)
>        at
>org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
>        at
>org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
>        at
>org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertT
a
>g.java:818)
>        at
>org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
>        at
>org.apache.jsp.base_0005flayout$jsp._jspService(base_0005flayout$jsp.ja
v
>a:1006)
>        at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.service(IDEJspServlet.java:173)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi
l
>e(IDEJspServlet.java:246)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ
s
>pServlet.java:339)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:683)
>        at
>org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis
p
>atcher.java:431)
>        at
>org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa
t
>cher.java:355)
>        at
>org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.ja
v
>a:1033)
>        at
>org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestPro
c
>essor.java:269)
>        at
>org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Ti
l
>esRequestProcessor.java:249)
>        at
>org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tile
s
>RequestProcessor.java:303)
>        at
>org.apache.struts.action.RequestProcessor.processActionForward(RequestP
r
>ocessor.java:401)
>        at
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
:
>279)
>        at
>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1407)
>        at
>org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:496)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
a
>tionFilterChain.java:247)
>        at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
t
>erChain.java:193)
>        at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
v
>e.java:243)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
v
>e.java:190)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.j
a
>va:246)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:23
4
>7)
>        at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a
>:180)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV
a
>lve.java:170)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a
>:170)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:46
8
>)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
.
>java:174)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.
j
>ava:1027)
>        at
>org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java
:
>1125)
>        at java.lang.Thread.run(Thread.java:536)
>----- Root Cause -----
>java.io.FileNotFoundException: /pages/wf_category/pager_region.jsp
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.loadJSP(IDEJ
s
>pServlet.java:376)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.loadIfNecessary(IDEJspServlet.java:148)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.service(IDEJspServlet.java:160)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi
l
>e(IDEJspServlet.java:246)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ
s
>pServlet.java:339)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:683)
>        at
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
p
>atcher.java:574)
>        at
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
t
>cher.java:497)
>        at
>org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.j
a
>va:819)
>        at
>org.apache.jsp.wf_0005fcategory_0005fchoose$jsp._jspService(wf_0005fcat
e
>gory_0005fchoose$jsp.java:107)
>        at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.service(IDEJspServlet.java:173)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi
l
>e(IDEJspServlet.java:246)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ
s
>pServlet.java:339)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:683)
>        at
>org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDis
p
>atcher.java:574)
>        at
>org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispa
t
>cher.java:497)
>        at
>org.apache.struts.tiles.TilesUtilStrutsModulesImpl.doInclude(TilesUtilS
t
>rutsModulesImpl.java:122)
>        at
>org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:161)
>        at
>org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:703)
>        at
>org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertT
a
>g.java:818)
>        at
>org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:467)
>        at
>org.apache.jsp.base_0005flayout$jsp._jspService(base_0005flayout$jsp.ja
v
>a:1006)
>        at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet$JspServletWr
a
>pper.service(IDEJspServlet.java:173)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.serviceJspFi
l
>e(IDEJspServlet.java:246)
>        at
>org.netbeans.modules.tomcat.tomcat40.runtime.IDEJspServlet.service(IDEJ
s
>pServlet.java:339)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispat
c
>her.java:683)
>        at
>org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDis
p
>atcher.java:431)
>        at
>org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispa
t
>cher.java:355)
>        at
>org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.ja
v
>a:1033)
>        at
>org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestPro
c
>essor.java:269)
>        at
>org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Ti
l
>esRequestProcessor.java:249)
>        at
>org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tile
s
>RequestProcessor.java:303)
>        at
>org.apache.struts.action.RequestProcessor.processActionForward(RequestP
r
>ocessor.java:401)
>        at
>org.apache.struts.action.RequestProcessor.process(RequestProcessor.java
:
>279)
>        at
>org.apache.struts.action.ActionServlet.process(ActionServlet.java:1407)
>        at
>org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:496)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
>        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>        at
>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applic
a
>tionFilterChain.java:247)
>        at
>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFil
t
>erChain.java:193)
>        at
>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVal
v
>e.java:243)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.core.StandardContextValve.invoke(StandardContextVal
v
>e.java:190)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.j
a
>va:246)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.core.StandardContext.invoke(StandardContext.java:23
4
>7)
>        at
>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.jav
a
>:180)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherV
a
>lve.java:170)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.jav
a
>:170)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:46
8
>)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:564)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve
.
>java:174)
>        at
>org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.j
a
>va:566)
>        at
>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
4
>72)
>        at
>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
>        at
>org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.
j
>ava:1027)
>        at
>org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java
:
>1125)
>        at java.lang.Thread.run(Thread.java:536)
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message