• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem with localization (MyFaces and JSTL)

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created a simple application that uses 2 languages - english and polish. I want to set locale with html link for myfaces and jstl tags.
The problem is that when i press the link, it only changes the messages outputed by jsf tags. The jstl messages remain unchanged.
The locale is changing (checked with c:out) but messages aren`t.
The funniest thing happends when i change language to english and check the chceckbox - All messages change to english and the jstl locale variable is emptied (c:out doesn`t write anything out).

This example worked with jsf1.1.5 but it doesn`t work with jsf 1.2.
Can any one tell me why??

I enclose the code of this example:
welcome.jsp


User.java


faces-config.xml


I`ve tried to download new jstl.jar and standard.jar, add tlds and declarations in web.xml but it didn`t help.

If anyone knows answer to this mystery please help.
 
Piotr Cierny
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my first post. Sorry for bad code. here is a good one.

welcome.jsp


User.java


faces-config.xml
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This was cross-posted in the sun forums. I've already answered there.

Originally posted by Piotr Cierny:
I have created a simple application that uses 2 languages - english and polish. I want to set locale with html link for myfaces and jstl tags.
The problem is that when i press the link, it only changes the messages outputed by jsf tags. The jstl messages remain unchanged.
The locale is changing (checked with c:out) but messages aren`t.
The funniest thing happends when i change language to english and check the chceckbox - All messages change to english and the jstl locale variable is emptied (c:out doesn`t write anything out).

This example worked with jsf1.1.5 but it doesn`t work with jsf 1.2.
Can any one tell me why??

I enclose the code of this example:
welcome.jsp


User.java


faces-config.xml


I`ve tried to download new jstl.jar and standard.jar, add tlds and declarations in web.xml but it didn`t help.

If anyone knows answer to this mystery please help.

 
Piotr Cierny
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I fixed the problem by adding locale="#{facesContext.viewRoot.locale}" to f:view tag.

But could anyone explain me why this does`t work without specifying the locale in the view tag?

Shouldn`t the fmt:setLocale tag set locale for jstl tags only using parameter given in URL
 
Is this the real life? Is this just fantasy? Is this a tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic