struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <>
Subject Re: sharing message resources with jstl
Date Sat, 22 Oct 2005 09:08:18 GMT
michael Muttai on 22/10/05 05:02, wrote:
> I have three message resources defined in struts-config.xml:
> <message-resources parameter="ErrorMessageResources" key="errors"/>
> <message-resources parameter="ApplicationMessageResources"/>
> <message-resources parameter="InfoMessageResources" key="info"/>
> In web.xml, I define a context parameter as follows,
> <context-param>
>   <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
>   <param-value>ApplicationMessageResources</param-value>
> </context-param>
> Questions:
> (1). Can I define more than message resources in context param?

I believe you are out of luck on this one. With JSTL as far as I can 
tell from the spec you can only access the one that you define above. 
But it doesn't necessarily rule it out, so perhaps I didn't read far enough.

> (2). In jsp, how do I access these three message resources?

<fmt:message key="esurvey.option.edit.optionText.label"/>

that accesses the web.xml defined bundle. I believe you would need the 
struts taglib 'bean:message' to access the other ones which you defined 
in struts-config. Check out the API for it on the struts website.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message