aspose file tools*
The moose likes JSP and the fly likes i18n  custom tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "i18n  custom tag" Watch "i18n  custom tag" New topic
Author

i18n custom tag

peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 314
I am looking for a custom tag that will help me with internationalization.

I want the tag to get the bundle based on bundle name and locale. Then it should look up the key in the bundle, create a MessageFormat object, and return the result from running the format method.

Please tell me there exists some public tag that can do this common thing.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

The JSTL 'fmt' class of tags does exactly what you are after.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

The Jakarta implementation of the JSTL is available from the sidebar of this page.

Be sure to get the right version for your version of JSP: JSTL 1.0 for JSP 1.2, or JSTL 1.1 for JSP 2.0.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60077
    
  65

Example usage:

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: i18n custom tag
 
Similar Threads
how to study custom tag
Regarding Resource Bundle
Struts Validator
Doubt in ResourceBundle
fmt:message tag does not work with "bundle" param