VisualBuilder
  Home > Jsp > Tutorials > Internationalization in JSP application - JSP Tutorial
Tell a friend
Link to us
Total Members
      Members: 84779
     
Sitemap Forum Chat
Home
JSP Tutorial Home
1 . Introduction to JSP
2 . Why use JSP?
3 . JSP compared to ASP,ASP.NET and Servlets
4 . JSP architecture
5 . Setting up the JSP environment
6 . Creating your first JSP page
7 . Using JSP tags
8 . Declaration tag
9 . Expression tag
10 . Directive tag
11 . Scriptlet tag
12 . Action tag
13 . Creating your second JSP page
14 . Implicit Objects
15 . Creating a Form
16 . Processing a Form
17 . Creating a Form (more elements)
18 . Processing a Form (more elements)
19 . Processing a Form (more elements-2)
20 . Getting Client Info
21 . Review and next steps
22 . Beans scopes in JSP
23 . JSP Bean scope examples
24 . Uploading Application in JSP.
25 . Modularization in JSP
26 . Exception Handling in JSP-1
27 . Exception Handling in JSP-2
28 . Session Tracking in JSP
29 . Security in JSP -2
30 . Security in JSP -1
31 . Internationalization in JSP application
32 . Introduction To Expression Language.
33 . Introduction to Tag libraries
34 . Introduction To Core Taglib -1
35 . Introduction To Core Taglib -2
36 . Function Taglib
37 . Database Handling in JSP.
38 . Creating User Defined Custom Tag -1
39 . Creating User Defined Custom Tag -2
40 . Best Practices in JSP
41 . JSP HTML Form source example
 
 
JSP Home
JSP Members (18740)
JSP Member Articles ( 11 )
JSP Discussion (74)
JSP Q & A ( 103 )
- JSP Ask Question
- JSP Questions
- JSP Unanswered Questions
JSP Resources
JSP Source Code (172)
JSP Articles (34)
JSP Blogs (333)
JSP Jobs (0)
JSP Components (10)
JSP Books (9)
JSP Websites (13)
JSP News (12)
 
GROUPS
.NET
ASP.NET
.NET
C#
ASP
Visual Basic
Java
Java
JSP
EJB
Other
Delphi
C++
Ajax
UML
JavaScript
PHP
Web Design
Web Hosting
SQL Server
Oracle
Project Management
More Groups

 
LEARNING CENTER
TUTORIALS
.NET
.NET Tutorial
ASP Tutorial
ASP.NET Database Tutorial
ASP.Net Security,Internationalisation And Deployment
ASP.NET Tutorial
C# Tutorial
Web Development
Flex Tutorial
HTML Tutorial
Learn AJAX Tutorial
PHP Tutorial
Software Development
Database Tutorial
SQL Tutorial
UML Tutorial
Java
Ant Tutorial
EJB 3 Tutorial
Hibernate Tutorial
Java Tutorial
Java Web Component Tutorial
Java XML Tutorial
JDBC Tutorial
JDK1.5 Tutorial
JSF Tutorial
JSP And J2EE Design Tutorial
JSP Tutorial
Spring Tutorial
Struts Tutorial

RESOURCES
Q & A (451 )
Source Code (3275 )
Articles (359 )
Books (372 )
Components (1596 )
News (892 )
Websites (1207 )

SUBMISSIONS
Submit Article
Submit Website
Submit News
Submit Source Code
Submit Component

COMMUNITY
Members Directory
Discussion Forum
Chat

SITE
About Us
Sitemap
Search
Contact Us
Link To Us
Feedback
Tell a Friend
Partners
Advertise

Jsp Tutorial
 Internationalization in JSP application
  << Prev: Security in JSP -1 Next: Introduction To Expression Language. >>

Few years back, the sites were developed using a single language and the developer used to create the sites to their specific languages. As the globalization occured, many frameworks have developed to support the multiple languages at a time. Now this can be achieved by having the multi language text in key/value pair and at runtime the text is read from the key as per the language required. This multilingual support is known as Internationalization. Internationalization is defined as the process of designing an application so that it can be adapted to various languages and regions without engineering changes.

The following classes are used to implement Internationalization to any site.

  • Locale - The fundamental Java class that supports internationalization is Locale . Each Locale represents a particular choice of country and language, and also a set of formatting assumptions for things like numbers and dates.
  • ResourceBundle - The java.util.ResourceBundle class provides the fundamental tools for supporting messages in multiple languages.
  • PropertyResourceBundle - One of the standard implementations of Resource Bundle allows you to define resources using the same "name=value" syntax used to initialize properties files. This is very convenient for preparing resource bundles with messages that are used in a web application, because these messages are generally text oriented.

Note:- The fmt is the jstl tag library used to implement the internationalization in JSP. The below example will tell you "how to use the fmt taglib in the application". The example displays the text coming from the different properties files. The properties file lables.properties is created with different locale suffix example en is for english, de for Germany etc. We have hello key in both the files. hello=This is german File in de file and hello=This is english File in english file.

Example JSP file Internationalization.jsp file .

<%@ taglib prefix="fmt" uri="/WEB-INF/fmt.tld"%><fmt:setLocale value="de" scope="session"/><fmt:bundle basename="com.visualbuilder.labels">
    <fmt:message>
    hello    </fmt:message>
</fmt:bundle>

Output:-

The file will display "This is german File" and if the locale is changed to en then it will display the "This is english file."


  << Prev: Security in JSP -1 Next: Introduction To Expression Language. >>
Jsp Tutorial Home
Give feedback and win a prize.

 
   Printer Friendly
   Email to a friend
   Add to my Favourites    
  Download PDF version
   Report Bad Submissions
   Submit Feedback
 
  Delicious   Digg   Technorati   Blink   Furl   Reddit   Newsvine   Google Click each image to add
this page to each site.
 
 
Welcome Guest Signup
MEMBER'S PANEL
EMAIL
PASSWORD
Forgot your password?
New User? Click Here!
 
Resend Activation Email!
 
SEARCH
 
Skype vs. sipcall
 
 
ADVERTISEMENT
 
 
 

Home | Login | About Us | Contact Us | Privacy Policy | Advertising