You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Anthony E. Carlos" <an...@digitalphenom.com> on 2003/08/13 10:09:26 UTC

VelocityStrutsTools

Hello all:

The documentation says that "Errors may stem from the validation of a 
submitted form or from the processing of a request." I know how the 
validation creates an ActionErrors object comprised of one or more 
ActionError objects. However, how do you create these while processing 
a request and have access to them from Velocity (using the ErrorsTool)?

I've instantiated the objects in my Action class:

ActionError error = new 
ActionError("error.adduser.usernamealreadyexists");
errors.add("error.adduser.usernamealreadyexists", error);

But, the ErrorsTool doesn't see it in my Velocity page:

$errors.getAll()<br>

renders as:

$errors.getAll()

Any help is appreciated.

Thanks!

Anthony Carlos


Re: VelocityStrutsTools

Posted by Simon Christian <si...@stoutstick.com>.
Can't remember for sure, but I think it was in an example Action class - 
possibly examples.app2.DemoAction from the velstruts examples. Must 
agree it doesn't get a great deal of documentation ;)

- s


Anthony E. Carlos wrote:

> Thanks, Simon! That did the trick! Just out of curiosity, how did you 
> find out about it? I couldn't find anything about it in the 
> documentation and the mail archives seem to be down...
> 
> Thanks again,
> 
> Anthony
> 
> On Wednesday, August 13, 2003, at 04:21  AM, Simon Christian wrote:
> 
>> Hi Anthony,
>>
>> It looks like you're not saving the errors within the Action class:
>>
>>     saveErrors(request, errors);
>>
>> - simon
>>
>>
>> Anthony E. Carlos wrote:
>>
>>> Hello all:
>>> The documentation says that "Errors may stem from the validation of a 
>>> submitted form or from the processing of a request." I know how the 
>>> validation creates an ActionErrors object comprised of one or more 
>>> ActionError objects. However, how do you create these while 
>>> processing a request and have access to them from Velocity (using the 
>>> ErrorsTool)?
>>> I've instantiated the objects in my Action class:
>>> ActionError error = new 
>>> ActionError("error.adduser.usernamealreadyexists");
>>> errors.add("error.adduser.usernamealreadyexists", error);
>>> But, the ErrorsTool doesn't see it in my Velocity page:
>>> $errors.getAll()<br>
>>> renders as:
>>> $errors.getAll()
>>> Any help is appreciated.
>>> Thanks!
>>> Anthony Carlos
>>> ---------------------------------------------------------------------
>>> 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
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
> 


Re: VelocityStrutsTools

Posted by Simon Christian <si...@stoutstick.com>.
Can't remember for sure, but I think it was in an example Action class - 
possibly examples.app2.DemoAction from the velstruts examples. Must 
agree it doesn't get a great deal of documentation ;)

- s


Anthony E. Carlos wrote:

> Thanks, Simon! That did the trick! Just out of curiosity, how did you 
> find out about it? I couldn't find anything about it in the 
> documentation and the mail archives seem to be down...
> 
> Thanks again,
> 
> Anthony
> 
> On Wednesday, August 13, 2003, at 04:21  AM, Simon Christian wrote:
> 
>> Hi Anthony,
>>
>> It looks like you're not saving the errors within the Action class:
>>
>>     saveErrors(request, errors);
>>
>> - simon
>>
>>
>> Anthony E. Carlos wrote:
>>
>>> Hello all:
>>> The documentation says that "Errors may stem from the validation of a 
>>> submitted form or from the processing of a request." I know how the 
>>> validation creates an ActionErrors object comprised of one or more 
>>> ActionError objects. However, how do you create these while 
>>> processing a request and have access to them from Velocity (using the 
>>> ErrorsTool)?
>>> I've instantiated the objects in my Action class:
>>> ActionError error = new 
>>> ActionError("error.adduser.usernamealreadyexists");
>>> errors.add("error.adduser.usernamealreadyexists", error);
>>> But, the ErrorsTool doesn't see it in my Velocity page:
>>> $errors.getAll()<br>
>>> renders as:
>>> $errors.getAll()
>>> Any help is appreciated.
>>> Thanks!
>>> Anthony Carlos
>>> ---------------------------------------------------------------------
>>> 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
>>
> 
> 
> ---------------------------------------------------------------------
> 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


Re: VelocityStrutsTools

Posted by "Anthony E. Carlos" <an...@digitalphenom.com>.
Thanks, Simon! That did the trick! Just out of curiosity, how did you 
find out about it? I couldn't find anything about it in the 
documentation and the mail archives seem to be down...

Thanks again,

Anthony

On Wednesday, August 13, 2003, at 04:21  AM, Simon Christian wrote:

> Hi Anthony,
>
> It looks like you're not saving the errors within the Action class:
>
> 	saveErrors(request, errors);
>
> - simon
>
>
> Anthony E. Carlos wrote:
>> Hello all:
>> The documentation says that "Errors may stem from the validation of a 
>> submitted form or from the processing of a request." I know how the 
>> validation creates an ActionErrors object comprised of one or more 
>> ActionError objects. However, how do you create these while 
>> processing a request and have access to them from Velocity (using the 
>> ErrorsTool)?
>> I've instantiated the objects in my Action class:
>> ActionError error = new 
>> ActionError("error.adduser.usernamealreadyexists");
>> errors.add("error.adduser.usernamealreadyexists", error);
>> But, the ErrorsTool doesn't see it in my Velocity page:
>> $errors.getAll()<br>
>> renders as:
>> $errors.getAll()
>> Any help is appreciated.
>> Thanks!
>> Anthony Carlos
>> ---------------------------------------------------------------------
>> 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
>


Re: VelocityStrutsTools

Posted by "Anthony E. Carlos" <an...@digitalphenom.com>.
Thanks, Simon! That did the trick! Just out of curiosity, how did you 
find out about it? I couldn't find anything about it in the 
documentation and the mail archives seem to be down...

Thanks again,

Anthony

On Wednesday, August 13, 2003, at 04:21  AM, Simon Christian wrote:

> Hi Anthony,
>
> It looks like you're not saving the errors within the Action class:
>
> 	saveErrors(request, errors);
>
> - simon
>
>
> Anthony E. Carlos wrote:
>> Hello all:
>> The documentation says that "Errors may stem from the validation of a 
>> submitted form or from the processing of a request." I know how the 
>> validation creates an ActionErrors object comprised of one or more 
>> ActionError objects. However, how do you create these while 
>> processing a request and have access to them from Velocity (using the 
>> ErrorsTool)?
>> I've instantiated the objects in my Action class:
>> ActionError error = new 
>> ActionError("error.adduser.usernamealreadyexists");
>> errors.add("error.adduser.usernamealreadyexists", error);
>> But, the ErrorsTool doesn't see it in my Velocity page:
>> $errors.getAll()<br>
>> renders as:
>> $errors.getAll()
>> Any help is appreciated.
>> Thanks!
>> Anthony Carlos
>> ---------------------------------------------------------------------
>> 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
>


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


Re: VelocityStrutsTools

Posted by Simon Christian <si...@stoutstick.com>.
Hi Anthony,

It looks like you're not saving the errors within the Action class:

	saveErrors(request, errors);

- simon


Anthony E. Carlos wrote:
> Hello all:
> 
> The documentation says that "Errors may stem from the validation of a 
> submitted form or from the processing of a request." I know how the 
> validation creates an ActionErrors object comprised of one or more 
> ActionError objects. However, how do you create these while processing a 
> request and have access to them from Velocity (using the ErrorsTool)?
> 
> I've instantiated the objects in my Action class:
> 
> ActionError error = new ActionError("error.adduser.usernamealreadyexists");
> errors.add("error.adduser.usernamealreadyexists", error);
> 
> But, the ErrorsTool doesn't see it in my Velocity page:
> 
> $errors.getAll()<br>
> 
> renders as:
> 
> $errors.getAll()
> 
> Any help is appreciated.
> 
> Thanks!
> 
> Anthony Carlos
> 
> 
> ---------------------------------------------------------------------
> 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


Re: VelocityStrutsTools

Posted by Simon Christian <si...@stoutstick.com>.
Hi Anthony,

It looks like you're not saving the errors within the Action class:

	saveErrors(request, errors);

- simon


Anthony E. Carlos wrote:
> Hello all:
> 
> The documentation says that "Errors may stem from the validation of a 
> submitted form or from the processing of a request." I know how the 
> validation creates an ActionErrors object comprised of one or more 
> ActionError objects. However, how do you create these while processing a 
> request and have access to them from Velocity (using the ErrorsTool)?
> 
> I've instantiated the objects in my Action class:
> 
> ActionError error = new ActionError("error.adduser.usernamealreadyexists");
> errors.add("error.adduser.usernamealreadyexists", error);
> 
> But, the ErrorsTool doesn't see it in my Velocity page:
> 
> $errors.getAll()<br>
> 
> renders as:
> 
> $errors.getAll()
> 
> Any help is appreciated.
> 
> Thanks!
> 
> Anthony Carlos
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>