Assuming you want to do this to make use of the <html:messages> tag... The
default ExceptionHandler (org.apache.struts.action.ExceptionHandler) creates
an ActionErrors object which encapsulates the error message derived from the
Exception and the ExceptionConfig.  By nature of the inheritance
relationship an ActionErrors is an ActionMessages.  Therefor you can use the
<html:messages> tag with the ActionErrors created by the ExceptionHandler.

In your page you can iterate over the ActionErrors created by the
ExceptonHandler like so...

<html:messages id="error">
   <li><c:out value="${error}" escapeXml="false"/></li>
</html:messages>

By default the "messages" tag will iterate over the ActionErrors rather than
the ActionMessages which is what you want in this case since
ExceptionHandler created and stored them as ActionErrors.

-- 
Norm Deane
MIS Consultant
Vanderbilt University
(615) 322-7855
[EMAIL PROTECTED] 

> -----Original Message-----
> From: Nathan Coast [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, November 13, 2003 4:20 AM
> To: Struts Users Mailing List
> Subject: ExceptionHandler to ActionError
> 
> 
> Hi
> 
> I'd like to catch exceptions in an exception handler and then 
> re-use the 
> ActionMessage mechanism to relay messages to the failed input 
> page.  Is this 
> possible?  What do I have to do within the ExceptionHandler 
> to invoke the 
> ActionMessage mechanism?
> 
> thanks
> Nathan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


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

Reply via email to