You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pete Gieser <pg...@tampabay.rr.com> on 2002/12/15 09:54:26 UTC

Error handling (ServletException)

Is there something special I have to do to handle a ServletException?
No matter what I try, the stack trace always seems to be sent to the 
standard Tomcat error page.  

I've tried configuring <global-exceptions> in struts-config, but that
doesn't seem to work.  What's the secret?

  <global-exceptions>
    <exception handler="org.apache.struts.action.ExceptionHandler"
               key="global.error.message" 
               path="/error" 
               scope="request"
               type="javax.servlet.ServletException" />
  </global-exceptions>

javax.servlet.ServletException: BeanUtils.populate
	at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:980)
	at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess
or.java:779)
	at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
246)
	at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
	at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)

Thanks!
Pete


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Error handling (ServletException)

Posted by Dan Tran <da...@hotmail.com>.
Your action throws an Exception which got rethrow as ServletException by the
controller if the original exception is not caught by your handler.

So you need to change your configuration to catch Exception ( or whatever
the real one is) not ServletException.

Hope this helps.

-D
----- Original Message -----
From: "Pete Gieser" <pg...@tampabay.rr.com>
To: <st...@jakarta.apache.org>
Sent: Sunday, December 15, 2002 12:54 AM
Subject: Error handling (ServletException)


> Is there something special I have to do to handle a ServletException?
> No matter what I try, the stack trace always seems to be sent to the
> standard Tomcat error page.
>
> I've tried configuring <global-exceptions> in struts-config, but that
> doesn't seem to work.  What's the secret?
>
>   <global-exceptions>
>     <exception handler="org.apache.struts.action.ExceptionHandler"
>                key="global.error.message"
>                path="/error"
>                scope="request"
>                type="javax.servlet.ServletException" />
>   </global-exceptions>
>
> javax.servlet.ServletException: BeanUtils.populate
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:980)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProcess
> or.java:779)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> 246)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
>
> Thanks!
> Pete
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>