| Author |
Support English & French with same jsp files to read different properties file
|
albert kao
Ranch Hand
Joined: Feb 04, 2010
Posts: 212
|
|
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.
|
 |
Bear Bibeault
Author and opinionated walrus
Marshal
Joined: Jan 10, 2002
Posts: 50691
|
|
|
That's JSTL not Spring. Moved to the JSP forum.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Mark E Hansen
Ranch Hand
Joined: Apr 01, 2009
Posts: 639
|
|
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
|
 |
 |
|
|
subject: Support English & French with same jsp files to read different properties file
|
|
|