Thanks, but the last paragraph was what I was asking for - I want to know, how to get
localized message from bundle in scriptlet in JSP because I didn't find other way how
to insert localized message from bundle to tiles tag - and globaly to any tag from
some special tag library, where I can't use OGNL and struts2 <s:text /> tag.
Thanks for example, I didn't find this in documentation.
Tom
------------ Původní zpráva ------------
Od: Jeromy Evans <jeromy.ev...@blueskyminds.com.au>
Předmět: Re: struts2 and tiles
Datum: 31.1.2009 12:04:44
----------------------------------------
On 31/01/2009, at 6:23 AM, Tom Pop wrote:
> Hello,
>
> please, can you show me on this example how to convert tiles from
> struts1 to struts2?
>
> This example defines localized page title attribute passed to
> template in struts1:
>
> <bean:define id="messages" name="<%=
> org.apache.struts.Globals.MESSAGES_KEY %>"
> type="org.apache.struts.util.MessageResources"/>
> <bean:define id="locale" name="locale" type="java.util.Locale"
> scope="session" />
> <%
> String docTitle = messages.getMessage(locale, "page.title");
> %>
> <tiles:insertDefinition name="layout-main">
> <tiles:putAttribute name="document-title" value="<%= docTitle
> %>" />
> </tiles:insertDefinition>
Tiles2 is used the same way in Struts 2 as in Struts 1. Include the
tiles dependencies and its listener and the insertDefintion tag will
work within a JSP as you'd expect. Include the tiles plugin for
improved integration (eg. tiles result type).
What you DO need to change in your example is the use of bean:define
and the inline scriptlet which are unrelated to Tiles and unnecessary
in Struts 2. Reading one of the articles about upgrading from Struts
1 to Struts 2 will help you understand this (plus the Struts2 pages on
i18n).
Hope that helps,
Jeromy Evans
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org