You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Billy Ng <kw...@earthlink.net> on 2004/03/08 08:35:15 UTC
Use MessageResource in taglib
Hi folks,
I need to get a value from the properties file. I can easily do it in action subclass with the getResource().getMessage() and in jsp with the bean:message tag. However, how I can it in a taglib?
Billy Ng
----------------------------------------------------
This mailbox protected from junk email by Matador
from MailFrontier, Inc. http://info.mailfrontier.com
Re: Use MessageResource in taglib
Posted by Adam Hardy <ah...@cyberspaceroad.com>.
On 03/08/2004 08:35 AM Billy Ng wrote:
> Hi folks,
>
> I need to get a value from the properties file. I can easily do it in action subclass with the getResource().getMessage() and in jsp with the bean:message tag. However, how I can it in a taglib?
>
MessageResources resources = (MessageResources)
context.getAttribute(Globals.MESSAGES_KEY);
String msg = resources.getMessage("my.key");
Adam
--
struts 1.1 + tomcat 5.0.16 + java 1.4.2
Linux 2.4.20 Debian
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org