velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Ivanov <andrei.iva...@ines.ro>
Subject Re: ErrorsTool ClassCastException
Date Fri, 02 Jan 2004 00:48:23 GMT

Indeed, it works with ActionError... I was using ActionMEssage because of 
http://jakarta.apache.org/struts/api/org/apache/struts/action/ActionError.html

which says: "Deprecated. Please use ActionMessage instead, deprecated in 
struts 1.2.1 "

Thanks.

On Tue, 30 Dec 2003, Nathan Bubna wrote:

> Andrei Ivanov said:
> > I have a problem using ErrorsTool:
> >
> > $errors.all throws an exception:
> >
> > Invocation of method 'getAll' in class
> > org.apache.velocity.tools.struts.ErrorsTool threw exception class
> > java.lang.ClassCastException : null
> >
> > java.lang.ClassCastException
> > at org.apache.velocity.tools.struts.ErrorsTool.get(Unknown Source)
> > at org.apache.velocity.tools.struts.ErrorsTool.getAll(Unknown
> > Source)
> ...
> > The code from the struts action that creates the ActionErrors:
> >
> > ActionErrors errors = new ActionErrors();
> > errors.add(ActionMessages.GLOBAL_MESSAGE,
> > new ActionMessage("error.catalogexception", "error message");
> 
> ErrorsTool expects ActionError instances (subclass of ActionMessage).
> 
> > saveErrors(request, errors);
> >
> > I'm using struts-1.1 with latest cvs version of velocity and velocity
> > tools.
> >
> > What can I do ?
> 
> for now, use the ActionMessagesTool for ActionMessages and the ErrorsTool for
> ActionErrors.
> 
> for more on this, see this thread:
> http://marc.theaimsgroup.com/?t=107047691500003&r=1&w=2
> 
> Nathan Bubna
> nathan@esha.com
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Mime
View raw message