2013/11/26 Lukasz Lichota <lukasz.lich...@ocado.com>: > 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?
Any action is always available on ValueStack, so you must add notifyAdmin(exception) to the base action class. Regards -- Ćukasz + 48 606 323 122 http://www.lenart.org.pl/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org