You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tom Pop <to...@email.cz> on 2009/01/27 23:26:25 UTC

struts2: resource bundle messages

Hello,

I can get localised messages in JSP like this:

<s:text name="key" />

How to do the same and assign the text to variable like this:

<%
    String text = getText("key");
%>

So - how to get message from resource bundle in JSP java code?
I can then put it for example to ALT attribute of image tag.

Thanks.
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: struts2: resource bundle messages

Posted by Dave Newton <ne...@yahoo.com>.
Tom Pop wrote:
> I can get localised messages in JSP like this:
> 
> <s:text name="key" />
> 
> How to do the same and assign the text to variable like this:
> 
> <%
>     String text = getText("key");
> %>
> 
> So - how to get message from resource bundle in JSP java code?
> I can then put it for example to ALT attribute of image tag.

<img src="..." alt="<s:text name="key"/>">

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re : struts2: resource bundle messages

Posted by François Rouxel <ro...@yahoo.com>.
alt="%{getText('key')}"

 ____________________________________________ ____________________________________________



----- Message d'origine ----
De : Tom Pop <to...@email.cz>
À : Struts Users Mailing List <us...@struts.apache.org>
Envoyé le : Mardi, 27 Janvier 2009, 17h26mn 25s
Objet : struts2: resource bundle messages

Hello,

I can get localised messages in JSP like this:

<s:text name="key" />

How to do the same and assign the text to variable like this:

<%
    String text = getText("key");
%>

So - how to get message from resource bundle in JSP java code?
I can then put it for example to ALT attribute of image tag.

Thanks.
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re:Re : struts2: resource bundle messages

Posted by Tom Pop <to...@email.cz>.
Thanks - and in for example tiles tag? This tag doesn't accept %{getText(...)} and I can't put there <s:text.../>, I can only put there <%= ... %> with variable...

Tom

> ------------ Původní zpráva ------------
> Od: François Rouxel <ro...@yahoo.com>
> Předmět: Re : struts2: resource bundle messages
> Datum: 27.1.2009 23:43:55
> ----------------------------------------
> if you are in a struts tag.
> 
> title="%{getText('key')}"
> 
> else you can use
> 
> title="<s:text name="key" />"
> 
>  ____________________________________________
> ____________________________________________
> 
> 
> 
> ----- Message d'origine ----
> De : Tom Pop <to...@email.cz>
> À : Struts Users Mailing List <us...@struts.apache.org>
> Envoyé le : Mardi, 27 Janvier 2009, 17h26mn 25s
> Objet : struts2: resource bundle messages
> 
> Hello,
> 
> I can get localised messages in JSP like this:
> 
> <s:text name="key" />
> 
> How to do the same and assign the text to variable like this:
> 
> <%
>     String text = getText("key");
> %>
> 
> So - how to get message from resource bundle in JSP java code?
> I can then put it for example to ALT attribute of image tag.
> 
> Thanks.
> Tom
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
>       
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re : struts2: resource bundle messages

Posted by François Rouxel <ro...@yahoo.com>.
if you are in a struts tag.

title="%{getText('key')}"

else you can use

title="<s:text name="key" />"

 ____________________________________________ ____________________________________________



----- Message d'origine ----
De : Tom Pop <to...@email.cz>
À : Struts Users Mailing List <us...@struts.apache.org>
Envoyé le : Mardi, 27 Janvier 2009, 17h26mn 25s
Objet : struts2: resource bundle messages

Hello,

I can get localised messages in JSP like this:

<s:text name="key" />

How to do the same and assign the text to variable like this:

<%
    String text = getText("key");
%>

So - how to get message from resource bundle in JSP java code?
I can then put it for example to ALT attribute of image tag.

Thanks.
Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org