What I do, instead of chaining the global error result to an error action,
is I use ognl in my error.jsp page to call a method and pass the exception
so it can be logged etc. In my base action class I have a
notifyAdmin(Exception) method.
In error.jsp:
<%-- Dummy expression to notify the admin --
hink you can catch it, then do log.error(e.getMessage(),e); and then
>> throw e;
>>
>>
>>
>>
>> From: Bhaarat Sharma
>> To: Struts Users Mailing List
>> Sent: Friday, July 31, 2009 5:03:34 AM
>> Subject: Re: com
a
> To: Struts Users Mailing List
> Sent: Friday, July 31, 2009 5:03:34 AM
> Subject: Re: common error page in struts2 application
>
> Sorry I am a little confused. Basically I need to be able to log the
> message by doing log.error(e.getMessage(), e); However, if i catch the
> er
I think you can catch it, then do log.error(e.getMessage(),e); and then throw e;
From: Bhaarat Sharma
To: Struts Users Mailing List
Sent: Friday, July 31, 2009 5:03:34 AM
Subject: Re: common error page in struts2 application
Sorry I am a little confused
Sorry I am a little confused. Basically I need to be able to log the
message by doing log.error(e.getMessage(), e); However, if i catch the
error and put it in the catch block then the global error page does not come
up (I am assuming because the exception is caught?)
If I do not catch the excep
will the global exception not recognize the exception if I am catching it??
I need to catch it because I want to put it in the logs. However, in my
example, if i am catching the exception then I am seeing that the error page
defined with global-results is not coming up.
do the global exception map
Bhaarat Sharma wrote:
Is there a way to just add [exception mapping] somewhere so that all
20 package mappings see it?
most of the packing are using struts-default
You could create your own base package and extend from that. Package
extension is also documented on the Struts 2 wiki (briefly):
one last question:
lets say my mapping comes out to be this
/chapterFour/Error.jsp
so will i add that in each package in my struts.xml. I have over 20 right
now.
Is there a way to just add it somewhere so that all 20 package mappings see
it?
most of the packing are using struts-default
thanks
On Thu, Jul 30, 2009 at 3:21 PM, Dave Newton wrote:
> Bhaarat Sharma wrote:
>
>> how do we map exceptions to a global result?
>>
>
> You may not know about the Struts 2 documentation wiki that has a page
> covering exception configuration:
>
> http://struts.apache.org/2.1.6/docs/exception
Bhaarat Sharma wrote:
how do we map exceptions to a global result?
You may not know about the Struts 2 documentation wiki that has a page
covering exception configuration:
http://struts.apache.org/2.1.6/docs/exception-configuration.html
Dave
On Thu, Jul 30, 2009 at 2:55 PM, Bhaarat Sharma wrote:
> how do we map exceptions to a global result?
>
> On Thu, Jul 30, 2009 at 2:41 PM, Dave Newton
> wrote:
>
> > Bhaarat Sharma wrote:
> >
> >> What is the way to provide a common error page in a struts2 application?
> >> an
how do we map exceptions to a global result?
On Thu, Jul 30, 2009 at 2:41 PM, Dave Newton wrote:
> Bhaarat Sharma wrote:
>
>> What is the way to provide a common error page in a struts2 application?
>> and
>> automatically redirect to the error page when errors occur?
>>
>
> Map exceptions to a
On Thu, Jul 30, 2009 at 2:41 PM, Dave Newton wrote:
> Bhaarat Sharma wrote:
>>
>> What is the way to provide a common error page in a struts2 application?
>> and
>> automatically redirect to the error page when errors occur?
>
> Map exceptions to a global result.
>
> Dave
>
Make sure you set erro
Bhaarat Sharma wrote:
What is the way to provide a common error page in a struts2 application? and
automatically redirect to the error page when errors occur?
Map exceptions to a global result.
Dave
-
To unsubscribe, e-mail:
Hi,
What is the way to provide a common error page in a struts2 application? and
automatically redirect to the error page when errors occur?
Thanks
15 matches
Mail list logo