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:[EMAIL PROTECTED]]
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:[EMAIL PROTECTED]]
> Sent: Monday, September 23, 2002 4:22 PM
> To: [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> 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:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 
> 


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to