You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Silva <ms...@authenex.com> on 2002/09/24 02:08:17 UTC

dynamic use of ApplicationResources.properties

hello again,

is there any way to dyanmically use ApplicationResources.properties in an Action class?  what i mean is that i want to Select a message from the Action class, and pass that message to the jsp.  this will allow me to have a much more generic page... i wont be ties to putting the message type on the page, but create it at run time.

thanks,
mark


-----Original Message-----
From: Martin Cooper [mailto:martin.cooper@tumbleweed.com]
Sent: Monday, September 23, 2002 5:03 PM
To: 'Struts Users Mailing List'
Subject: RE: Struts vs. JSTL for i18n




> -----Original Message-----
> From: Matt Raible [mailto:matt@raibledesigns.com]
> Sent: Monday, September 23, 2002 4:22 PM
> To: roller-development@lists.sourceforge.net;
> struts-user@jakarta.apache.org
> Subject: Struts vs. JSTL for i18n
> 
> 
> It seems that Struts makes it much easier to do i18n than 
> JSTL.  Please
> correct me if I'm wrong.
> 
> Struts = <bean:message key="index.title"/>
> 
> JSTL = 
>   <fmt:bundle basename="org.roller.presentation.AppResources">
>    <fmt:message key="index.title"/>
>   </fmt:bundle>

There's a distinction here that you are missing, I think. In the Struts
case, you are taking advantage of your Struts configuration, which causes
Struts to load your resource bundles. When using JSTL, you can preload the
bundles as well, so the JSP code is almost the same.

For the default bundle, you might have:

Struts = <bean:message key="index.title"/>
JSTL = <fmt:message key="index.title"/>

With a non-default bundle, you might have:

Struts = <bean:message key="index.title" bundle="yourBundle"/>
JSTL = <fmt:message key="index.title" bundle="yourBundle"/>

With JSTL, you'll have to make the bundles available yourself, but once
that's done, you can take your pick over which set of tags to use.

--
Martin Cooper


> 
> Thanks,
> 
> Matt
> 
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: dynamic use of ApplicationResources.properties

Posted by Eddie Bush <ek...@swbell.net>.
You're not looking for <bean:message key=""/> are you?  Sounds like it, 
but I could be *way* off ...

Mark Silva wrote:

>hello again,
>
>is there any way to dyanmically use ApplicationResources.properties in an Action class?  what i mean is that i want to Select a message from the Action class, and pass that message to the jsp.  this will allow me to have a much more generic page... i wont be ties to putting the message type on the page, but create it at run time.
>
>thanks,
>mark
>

-- 
Eddie Bush




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>