• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSTL: Changing the case with i18n tags

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I am using JSTL in JSPs for internationalizing my application. In it there are several occurrences where a text string is used in multiple places with just the difference in case. To cater this I have to create 2 entries for such strings in my properties file, one for lower case and the other for upper case. Is there anyway that I can capitalize the text JSP by using the lower case entry in my properties file? In this way I can reduce the entries in my properties files.

I am using the JSTL distributable provided in Weblogic 9.2 (which are <fmt:message key=""/>, <fmt:setBundle app=""/> etc.) I have tried mixing it with the 'functions' tags/actions (the fn:toUpperCase method) but to no avail. Any idea or suggestion will be helpful.

Thanks.
 
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Crossposted: http://forums.sun.com/thread.jspa?threadID=5379194&tstart=0
Please read this: http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites
 
Haq Yunus
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, as I didn't know about this and will take care in the future. Thanks for letting me know.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Would it not be easier to have the mixed case version in the properties file and simply lowercase the entry when necessary?
 
Haq Yunus
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Bear, I'm a bit confused here: how will I lower case it in the JSP? By fn:toLowerCase method (if not toUpperCase which I was trying to use before)? But as I told you it is not working.
Thanks
reply
    Bookmark Topic Watch Topic
  • New Topic