You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Vernon <ve...@gatewaytech.com> on 2003/05/13 20:17:50 UTC
Tiles i18n question
Hi, Cedric,
Sorry to bother you again.
Back to the i18n Tiles question I posted more than two weekends, I am still
trying to have a solution. The issue is resource bundle approach with
Tiles. I can't find any document nor examples to backup your statement that
Tiles works with resource bundle. To my own experience, it works with the a
page per locale approach, which demonstrated in an example, but not with
resource bundle approach. The application scope page caching prevents a
page with a different locale generated. I use the XML centralized
definition method by the way.
--
Regards,
Vernon
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Tiles i18n question
Posted by Vernon <ve...@gatewaytech.com>.
The issue I have with Tiles is that no every user get a localized page
according to his or her locale. The locale setting is correct after I
modified the getDefinitionsFactoryKey of the I18nFactorySet class. I don't
have any issue with user setting or changing locale, but a user have a page
with the desired pre-set locale.
On Wed, 14 May 2003 13:13:21 +1200, Jason Lea <ja...@kumachan.net.nz>
wrote:
> Vernon wrote:
>> Hi, Jason,
>>
>> Thanks very much for your response. And see below.
>>
>>
>>> Tiles (the framework) doesn't use resource bundles. The resource
>>> bundles are accessed in Actions or in the .jsp page (Tile) with
>>> <bean:message>.
>>>
>>> Tiles supports i18n by providing different definitions based on locale.
>>>
>>> Example:
>>>
>>> ...
>>>
>>
>> What you describe here is the a page per locale approach I stated in my
>> post. Are you sure Tiles indeed DOESN'T support the resource bundle
>> approach? I can't disagree with you after more than a month with Tiles.
>> The followings, however, is what I get straight from the horse's mouth:
>>
>> |For my application, the locale needs to be checked every single page is
>> loaded. The reason |behind that is I follow the approach stated on
>> http://developer.java.sun.|com/developer/technicalArticles/Intl/
>> MultilingualJSP/.The
>> locale on the first few pages is determined by the browser. Also, I want
>> to keep my localization |approach: using JSTL/resource Bundle, but not a
>> page per locale as demonstrated in the Tiles |documentation. Is a
>> achievable goal with Tiles? Absolutely. You can mix both approach if
>> you want, or use the one you want.
>> Cedric
>>
>> The above is quoted from an email on April 22 in this mailing list. If
>> my comprehension is acceptable, what Cedric said here is that resource
>> bundle can be used in Tiles.
>>
>> My experience with Tiles in this regard is not funny at all. Don't get
>> me wrong, I think it is a usageful component.
>
> Ahh, JSTL / Resource bundles...
>
> I was describing how I used Tiles with Struts. I use the resource
> bundles that Struts loads as MessageResources, and use the Struts Taglibs
> to write out those values. It works and it is not a page per locale. I
> can use the one layout and one set of tiles for serving up content to
> multiple languages from a set of resource bundles. However Tiles gives
> me option of overriding one locale to provide a different layout if I
> choose.
>
> I had a look at using JSTL/resource bundles, but ran into a problem (it
> could be the one you mention above). I use Tomcat V4.1.24. With JSTL
> the locale gets set for the first user to access any page, and users with
> different locales get messages from the first locale. It was mentioned
> on a mailing list/forum somewhere. I think it suggested the problem was
> Tomcat's implementation where it failed to reset the locale when the page
> closes.
>
> I will have a look around for the message, I don't have it handy...
>
>
--
Regards,
Vernon
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Tiles i18n question
Posted by Jason Lea <ja...@kumachan.net.nz>.
Vernon wrote:
> Hi, Jason,
>
> Thanks very much for your response. And see below.
>
>
>> Tiles (the framework) doesn't use resource bundles. The resource
>> bundles are accessed in Actions or in the .jsp page (Tile) with
>> <bean:message>.
>>
>> Tiles supports i18n by providing different definitions based on locale.
>>
>> Example:
>>
>> ...
>>
>
> What you describe here is the a page per locale approach I stated in my
> post. Are you sure Tiles indeed DOESN'T support the resource bundle
> approach? I can't disagree with you after more than a month with Tiles.
> The followings, however, is what I get straight from the horse's mouth:
>
>
> |For my application, the locale needs to be checked every single page is
> loaded. The reason |behind that is I follow the approach stated on
> http://developer.java.sun.|com/developer/technicalArticles/Intl/
> MultilingualJSP/.The
> locale on the first few pages is determined by the browser. Also, I want
> to keep my localization |approach: using JSTL/resource Bundle, but not a
> page per locale as demonstrated in the Tiles |documentation. Is a
> achievable goal with Tiles?
> Absolutely. You can mix both approach if you want, or use the one you
> want.
>
> Cedric
>
> The above is quoted from an email on April 22 in this mailing list. If
> my comprehension is acceptable, what Cedric said here is that resource
> bundle can be used in Tiles.
>
> My experience with Tiles in this regard is not funny at all. Don't get
> me wrong, I think it is a usageful component.
Ahh, JSTL / Resource bundles...
I was describing how I used Tiles with Struts. I use the resource
bundles that Struts loads as MessageResources, and use the Struts
Taglibs to write out those values. It works and it is not a page per
locale. I can use the one layout and one set of tiles for serving up
content to multiple languages from a set of resource bundles. However
Tiles gives me option of overriding one locale to provide a different
layout if I choose.
I had a look at using JSTL/resource bundles, but ran into a problem (it
could be the one you mention above). I use Tomcat V4.1.24. With JSTL
the locale gets set for the first user to access any page, and users
with different locales get messages from the first locale. It was
mentioned on a mailing list/forum somewhere. I think it suggested the
problem was Tomcat's implementation where it failed to reset the locale
when the page closes.
I will have a look around for the message, I don't have it handy...
--
Jason Lea
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Tiles i18n question
Posted by Jason Lea <ja...@kumachan.net.nz>.
Found the link to the JSTL/Tomcat/locale changing problem:
http://forum.java.sun.com/thread.jsp?thread=336253&forum=45&message=1510599
--
Jason Lea
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Tiles i18n question
Posted by Vernon <ve...@gatewaytech.com>.
Hi, Jason,
Thanks very much for your response. And see below.
> Tiles (the framework) doesn't use resource bundles. The resource bundles
> are accessed in Actions or in the .jsp page (Tile) with <bean:message>.
>
> Tiles supports i18n by providing different definitions based on locale.
>
> Example:
>
> ...
>
What you describe here is the a page per locale approach I stated in my
post. Are you sure Tiles indeed DOESN'T support the resource bundle
approach? I can't disagree with you after more than a month with Tiles. The
followings, however, is what I get straight from the horse's mouth:
|For my application, the locale needs to be checked every single page is
loaded. The reason |behind that is I follow the approach stated on
http://developer.java.sun.|com/developer/technicalArticles/Intl/
MultilingualJSP/.The
locale on the first few pages is determined by the browser. Also, I want
to keep my localization |approach: using JSTL/resource Bundle, but not a
page per locale as demonstrated in the Tiles |documentation. Is a
achievable goal with Tiles?
Absolutely. You can mix both approach if you want, or use the one you
want.
Cedric
The above is quoted from an email on April 22 in this mailing list. If my
comprehension is acceptable, what Cedric said here is that resource bundle
can be used in Tiles.
My experience with Tiles in this regard is not funny at all. Don't get me
wrong, I think it is a usageful component.
--
Regards,
Vernon
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Tiles i18n question
Posted by Jason Lea <ja...@kumachan.net.nz>.
Vernon wrote:
>
> Hi, Cedric,
>
> Sorry to bother you again.
>
> Back to the i18n Tiles question I posted more than two weekends, I am
> still trying to have a solution. The issue is resource bundle approach
> with Tiles. I can't find any document nor examples to backup your
> statement that Tiles works with resource bundle. To my own experience,
> it works with the a page per locale approach, which demonstrated in an
> example, but not with resource bundle approach. The application scope
> page caching prevents a page with a different locale generated. I use
> the XML centralized definition method by the way.
Tiles (the framework) doesn't use resource bundles. The resource
bundles are accessed in Actions or in the .jsp page (Tile) with
<bean:message>.
Tiles supports i18n by providing different definitions based on locale.
Example:
Say we have a default layout defined in *tiles-defs.xml* as follows:
<tiles-definitions>
<definition name=".mainLayout"
path="/WEB-INF/jsp/layouts/basicLayout.jsp">
<put name="header" value="/WEB-INF/jsp/tiles/header.jsp"/>
<put name="menu" value="/WEB-INF/jsp/tiles/menu.jsp"/>
<put name="body" value="/WEB-INF/jsp/tiles/body.jsp"/>
</definition>
</tiles-definitions>
The basicLayout.jsp might put the header.jsp at the top, menu.jsp on the
left, and body.jsp in the center of a page using tables or css for layout.
Each header.jsp, menu.jsp and body.jsp page should use <bean:message
key="something"> to write out text taken from the resource bundles you
have created.
If you accessed this using a locale of 'en' (English) or 'ja' (Japanese)
everything would be displayed the same but the messages would come from
the corresponding resource bundles if they exist.
If you decided that the Japanese layout should be different somehow...
perhaps the menu should be on the right-hand side or perhaps a different
header.jsp should be used which links to japanese images then you might
create the following in *tiles-defs_ja.xml* (<--- notice the _ja here):
<tiles-definitions>
<definition name=".mainLayout"
path="/WEB-INF/jsp/layouts/basicLayout_ja.jsp">
<put name="header" value="/WEB-INF/jsp/tiles/header_ja.jsp"/>
<put name="menu" value="/WEB-INF/jsp/tiles/menu.jsp"/>
<put name="body" value="/WEB-INF/jsp/tiles/body.jsp"/>
</definition>
</tiles-definitions>
The _ja in the .jsp page names are just my convention, you could put
them into directory structure instead eg
/WEB-INF/jsp/ja/layouts/basicLayout.jsp,
/WEB-INF/jsp/ja/tiles/header_ja/jsp. But if I only support a couple of
languages or only a few pages need changing it makes it easy to see
which ones are language specific.
The basicLayout_ja.jsp would place the tiles in a different place, and
header_ja.jsp would link to some Japanese images.
menu.jsp and body.jsp get their content from the resource bundles so
they don't change.
--
Jason Lea
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
[OT] Error in tomcat 4.1.12 and 4.1.18 while installing an application
Posted by Ashish Kulkarni <ku...@yahoo.com>.
Hi,
i am cut pasting the error code which i get when i try
to deploy an application in tomcat4.1.12 or in
tomcat4.1.18
I have a directory temp in c:\tomcat4.1.12 ( that is
where i have installed tomcat)
I am usng windows 2000
ContextConfig[/mapsweb6102] Exception processing JAR
at resource path /WEB-INF/lib/x4j400.jar
javax.servlet.ServletException: Exception processing
JAR at resource path /WEB-INF/lib/x4j400.jar
at
org.apache.catalina.startup.ContextConfig.tldScanJar(ContextConfig.java:930)
at
org.apache.catalina.startup.ContextConfig.tldScan(ContextConfig.java:868)
at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:647)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
=====
A$HI$H
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org