• 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

Support English & French with same jsp files to read different properties file

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We want to support internationalization and localization of the English and French language with our web application.
Is it feasible by using the same jsp files to read different properties file?
i.e. We plan to create a 'messages_en.properties' file for the English resource bundle
and 'messages_fr.properties' file for the French resource bundle.
Can the properties files be placed in the same source directory, then build English & French resource bundles and put in the same 'war/WEB-INF/classes' directory?
For our jsp files, we will do
<fmt:bundle basename="class.path.to.our.resource.bundle">
<fmt:message key="our.message.key"/>
</fmt:bundle>

Is there any tutorial or sample source code?
We use spring 2.5.6.SEC01.
 
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
That's JSTL not Spring. Moved to the JSP forum.
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The book Core Servlets and JavaServer Pages goes through this for JSP. Yes it can be done and yes, it's pretty easy.
Note that frameworks usually have their own way of doing it. The way you do this in Spring may be different (although as
Spring is built on top of JSP, I would expect you can still use the JSP mechanism).

Note that the book referenced above is available for free download as PDF chapters from the book's web site http://pdf.coreservlets.com
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic