velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marino A. Jonsson" <marino_jons...@hotmail.com>
Subject Re: Another problem with multiple application resources
Date Wed, 07 Jan 2004 20:58:22 GMT
I have to add ... since you are only using a single bundle in each module
you shouldn't have to specify bundle names at all!

In Struts-Config.xml:

            <!-- ================================ Message Resources
Definitions -->

            <message-resources parameter="ApplicationResources"/>



      In Struts-Config-admin.xml :

            <!-- ================================ Message Resources
Definitions -->

            <message-resources parameter="ApplicationResources-admin"/>


You only need to use bundle names (keys) if you use more than one bundle for
a single module.
This way you only need $msg.get("users.state.displayName") and the foreach
loop should also work :)

cheers,
Marinů


"Nathan Bubna" <nathan@esha.com> wrote in message
news:010d01c3d550$883e7380$667ba8c0@zeus.esha.com...
> 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
> nathan@esha.com




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