Date: Tue, 22 Mar 2016 20:13:37 +0000
Subject: Specific Exception Handling
From: [email protected]
To: [email protected]
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.
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:
In which part of the app use the URL action actionspecificexeption?
MG>when op first executes login.jsp as seen below: <action
name="actionspecificexception"
class="org.apache.struts.register.action.Register"
method="throwSecurityException">
<exception-mapping
exception="org.apache.struts.register.exceptions.SecurityBreachException"
result="login" />
<result>/register.jsp</result>
<result name="login">/login.jsp</result>
</action>If the method throwsSecurityException always throws
SecurityBreachException why do we need the other result?
MG><result>/register.jsp</result> is default result when processed by
org.apache.struts.register.action.Register that returns SUCCESS
MG>https://struts.apache.org/docs/exception-handling.html
--
Un saludo,José A.
MG>¿Claro?MG>/Saludos Cordiales/MG>Martín