You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Dennis Muhlestein <de...@zserve.com> on 2002/10/17 18:56:47 UTC

Exception Page

I like the global exception handler in struts 1.1b2.

I have a question I haven't found in the docs.  (Maybe I haven't looked
hard enough if someone can point the way).

If Struts forwards to the global exception page, is there a request or
other attribute that contains a throwable object?  Like if you use the
jsp error page directive, you get an object called exception.  

I'd rather just log the exception there, than catch it in the action,log
it, then throw it again.

Any suggestions?

Thanks
Dennis



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


Re: Exception Page

Posted by Dennis Muhlestein <de...@zserve.com>.
Thanks, That's exactly what I needed.

<FlameProtection>
And, BTW, when is struts 1.1 releasing :-)
He he just kidding.
</FlameProtection>

On Thu, 2002-10-17 at 12:13, Joe Germuska wrote:
> At 10:56 AM -0600 2002/10/17, Dennis Muhlestein wrote:
> >I like the global exception handler in struts 1.1b2.
> >
> >I have a question I haven't found in the docs.  (Maybe I haven't looked
> >hard enough if someone can point the way).
> >
> >If Struts forwards to the global exception page, is there a request or
> >other attribute that contains a throwable object?  Like if you use the
> >jsp error page directive, you get an object called exception. 
> >
> >I'd rather just log the exception there, than catch it in the action,log
> >it, then throw it again.
> 
> In short, the answer is yes.  The default ExceptionHandler stores the 
> exception as a request attribute under the key 
> org.apache.struts.action.Action.EXCEPTION_KEY (a String constant 
> defined as "org.apache.struts.action.EXCEPTION")
> 
> This is part of the default behavior in 
> org.apache.struts.action.ExceptionHandler; you can subclass this and 
> specify your subclass as the handler for certain types of exceptions 
> in struts-config.
> 
> Joe
> 
> -- 
> --
> * Joe Germuska    { joe@germuska.com }
> "It's pitiful, sometimes, if they've got it bad. Their eyes get 
> glazed, they go white, their hands tremble.... As I watch them I 
> often feel that a dope peddler is a gentleman compared with the man 
> who sells records."
> 	--Sam Goody, 1956
> 
> --
> 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>


Re: Exception Page

Posted by Joe Germuska <Jo...@Germuska.com>.
At 10:56 AM -0600 2002/10/17, Dennis Muhlestein wrote:
>I like the global exception handler in struts 1.1b2.
>
>I have a question I haven't found in the docs.  (Maybe I haven't looked
>hard enough if someone can point the way).
>
>If Struts forwards to the global exception page, is there a request or
>other attribute that contains a throwable object?  Like if you use the
>jsp error page directive, you get an object called exception. 
>
>I'd rather just log the exception there, than catch it in the action,log
>it, then throw it again.

In short, the answer is yes.  The default ExceptionHandler stores the 
exception as a request attribute under the key 
org.apache.struts.action.Action.EXCEPTION_KEY (a String constant 
defined as "org.apache.struts.action.EXCEPTION")

This is part of the default behavior in 
org.apache.struts.action.ExceptionHandler; you can subclass this and 
specify your subclass as the handler for certain types of exceptions 
in struts-config.

Joe

-- 
--
* Joe Germuska    { joe@germuska.com }
"It's pitiful, sometimes, if they've got it bad. Their eyes get 
glazed, they go white, their hands tremble.... As I watch them I 
often feel that a dope peddler is a gentleman compared with the man 
who sells records."
	--Sam Goody, 1956

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