2016-03-22 21:13 GMT+01:00 José Antonio Delgado Trujillo <jadt...@gmail.com> :
> In the example of exception - handling explains how to configure an > specific exception for an action. > > It is simple, only write the exception-mapping into the action node. But i > don't know how it works and why we need two result nodes. > You can define exception-mapping in two places: package-wide and action-wide when action-wide takes precedence over package-wide > > [image: Imágenes integradas 1] > > I understood that if the method throwSecurityException of the Register > class throws SecurityBreachException, the action returns the result login > and then it redirects to login.jsp but: > Nope, it doesn't return "login" result, it throws the SecurityBreachException and now framework catches it and search for matching exception-mapping based on the exception's class > > - In which part of the app use the URL action actionspecificexeption? > > Here https://github.com/apache/struts-examples/blob/master/exception-handling/src/main/webapp/index.jsp#L30 > > - > - If the method throwsSecurityException always throws > SecurityBreachException why do we need the other result? > > To simulate real life app ;-) Normally methods don't throw exception all the time Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/