Is there a way to register multiple message resources in context so I can
get access to them by <fmt:message> tag?
Michael
From: Adam Hardy <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <user@struts.apache.org>
To: Struts Users Mailing List <user@struts.apache.org>
Subject: Re: sharing message resources with jstl
Date: Sat, 22 Oct 2005 10:08:18 +0100
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.
Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]