struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lichota <lukasz.lich...@ocado.com>
Subject Sending email on uncought exception problems
Date Tue, 26 Nov 2013 12:44:35 GMT
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