Nathan, tell me something, am I missing something?

I tried these and none of them worked out

$errors.get($null, "adminResources") 
$errors.get("error.required", "adminResources") 
$errors.get("org.apache.struts.action.GLOBAL_ERROR", "adminResources") 


I tried these and look at the results

$errors.getMsgs($null, "adminResources")        --> "The is required"

There's nothing between "The" and "is" and there should be the 
"user.email.displayName" key, translated to the word "email" which is in 
AppliationReources-admin.xml

And I still don't get why the get method of $errors doesn't show anything.





-----Mensaje original-----
De: Nathan Bubna [mailto:[EMAIL PROTECTED] 
Enviado el: Mi�rcoles, 07 de Enero de 2004 01:01 p.m.
Para: Velocity Users List
Asunto: Re: Another problem with multiple application resources


Iv�n Escobedo said:
...
>       I'm using velocitytools 1.1 beta
>
>       Struts 1.1
>
>       A default module and another module called admin
...
>      I'm working on admin module and I have a vm file, the look up for 
> the messages is working ok, like this
>
>          $msg.get("users.state.displayName", "adminResources")
>
>     but this one is not working
>
>          #if ($errors.exist())
>              $msg.get("errors.header")
>              #foreach ($e in $errors.all )
>                 $msg.get("errors.prefix) $e $msg.get("errors.suffix")
>              #end
>              $msg.get("errors.footer")
>        #end
>
>     I changed the $msg and put the "adminResources" and it works fine, 
> but the #foreach function is not displying anything, it's like $errors 
> is not using the ApplicationResources-admin

you're right, it's not.

> How does the ErrorTool know which applicationresources to use? This 
> worked fine in velocity tools 1.0 and now this is the only and the 
> last problem i have with modules-struts-velocity

just like the MessageTool, you have to tell it which resource bundle to use. the 
getAll() method ($errors.all) doesn't specify a bundle.

try doing  #foreach( $e in $errors.get($null, "adminResources") )

also, i'm going to add a getAll(String bundle) method for the next release. i'll check 
the change in today, so you can use it if you don't mind building VelocityTools from 
CVS on your own.

Nathan Bubna
[EMAIL PROTECTED]


---------------------------------------------------------------------
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