Hi,
You can use the tag "exception" inside the tag action for local
exception, or global-exceptions for global ones.

For example:
<action type="com.foo.FooAction" path="/fooPath" >
             <exception key="foo.error" path="error.in.form"
scope="request" type="java.lang.NullPointerException"/>
             <forward name="okform" path="okform"/>
</action>

or
    <global-exceptions>
        <exception key="global.error.invalidlogin" path="error"
scope="request" type="com.foo.InvalidLoginException"/>
        <exception key="global.error.invalidtoken" path="error.in.form"
scope="request" type="com.foo.TokenInvalidException"/>
    </global-exceptions>

The attribute "path" can be a JSP page or a tiles which contains the
html:errors tag.
The attribute key contains a resource message.

BR
/Amleto


> -----Messaggio originale-----
> Da: Manisha Sathe [mailto:[EMAIL PROTECTED] 
> Inviato: marted́ 11 gennaio 2005 10.26
> A: user@struts.apache.org
> Oggetto: Handling the exceptions in struts
> 
> 
> I am trying to have a common routine for Exceptions.
>  
> Inside Action Class I am calling this common method, passing 
> ActionMapping as parameter, doing some stuff like logging and 
> then forwarding to error page.
>  
> But the problem is what if i get exception in my normal 
> Common Java files (which does not have ActionMapping) - then 
> how i can forward it to error page ?
>  
> I am bit confused in how to handle exceptions in effective 
> way. Pls guide me.
>  
> regards
> Manisha
>  
>  
>  
>  
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 10/01/2005
>  
> 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 265.6.10 - Release Date: 10/01/2005
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to