Re: common error page in struts2 application

2009-07-31 Thread Greg Lindholm
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 --

Re: common error page in struts2 application

2009-07-31 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-31 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-31 Thread mailtolouis2020-struts
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

Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-30 Thread Dave Newton
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):

Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-30 Thread Dave Newton
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

Re: common error page in struts2 application

2009-07-30 Thread Greg Lindholm
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

Re: common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
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

Re: common error page in struts2 application

2009-07-30 Thread Wes Wannemacher
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

Re: common error page in struts2 application

2009-07-30 Thread Dave Newton
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:

common error page in struts2 application

2009-07-30 Thread Bhaarat Sharma
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