struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel Almeida <mig...@almeida.at>
Subject Re: Sending email on uncought exception problems
Date Tue, 26 Nov 2013 15:19:17 GMT
The first thought I had was also that this might be better suited on an
interceptor. You'll also have more control over the desired behaviour
since interceptors are more easily testable than JSPs.

Miguel
On Tue, 2013-11-26 at 09:43 -0500, Dave Newton wrote:

> Why not use an interceptor?
> 
> Dave
> 
> 
> 
> On Tue, Nov 26, 2013 at 7:44 AM, Lukasz Lichota <lukasz.lichota@ocado.com>wrote:
> 
> > hello,
> >
> > I'd like to run some java code on any uncought exception but so far I
> > cannot find a solution.
> > Under this link I found the exactly same question but I do not know how to
> > apply solution.
> >
> > http://markmail.org/search/?q=global+exception+redirect+list%3Aorg.apache.struts.users%2F#query:global%20exception%20redirect%20list%3Aorg.apache.struts.users%2F+page:1+mid:wmzqlmfqpzd57dhg+state:results
> >
> > Namely if I have
> > <s:if test="notifyAdmin(exception)"></s:if>
> > then in which class this method should be? Error.jsp is not associated with
> > any action. The author says he has this method in any Action class but for
> > me it doesn't work (how could it work anyway? how error.jsp know about any
> > Action class?
> >
> > I tried also s:action element like that:
> > <s:action name="default-error!notifyAdmin" executeResult="false">
> > <s:param>%{exception}</s:param>
> > </s:action>
> >  and having java class with method like that:
> > @Action("default-error")
> > public boolean notifyAdmin(Exception exception)
> >
> > but it fails with no error message so I even do not know what is happening
> > (by failing I mean nothing is invoked when rendering the error page)
> >
> > I also found this
> > http://www.mkyong.com/struts/struts-global-custom-exception-example/ but
> > it
> > looks like exception handler was removed in struts 2.0
> >
> > Can you offer any hint?
> >
> > Thanks
> > Lukasz
> >
> > --
> > Notice:  This email is confidential and may contain copyright material of
> > Ocado Limited (the "Company"). Opinions and views expressed in this message
> > may not necessarily reflect the opinions and views of the Company.
> >
> > If you are not the intended recipient, please notify us immediately and
> > delete all copies of this message. Please note that it is your
> > responsibility to scan this message for viruses.
> >
> > Company reg. no. 3875000.
> >
> > Ocado Limited
> > Titan Court
> > 3 Bishops Square
> > Hatfield Business Park
> > Hatfield
> > Herts
> > AL10 9NE
> >
> 
> 
> 



Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message