struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: Specific Exception Handling
Date Tue, 22 Mar 2016 20:57:11 GMT
     Date: Tue, 22 Mar 2016 20:13:37 +0000
Subject: Specific Exception Handling

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 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
Un saludo,José A.
MG>¿Claro?MG>/Saludos Cordiales/MG>Martín
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message