• 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

The value is not displaying correctly in I18N

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

I am using the I18N to display the messages in my JSP. I am using JSTL 1.1, JSP 2.0, Tomcat 6.0.14.

ControllerMessages.java is as follows:
___________________________________________________________

package com.controller.messages;

import java.util.ListResourceBundle;

public class ControllerMessages extends ListResourceBundle {
static final Object[][] contents = {
{ "CMP", "Components" },
{ "STATUS", "Status" },
{ "CE", "Content Engine" },
{ "ALIVE", "ALIVE" },
{ "OSE", "Object store exists" },
{ "TRUE", "TRUE" },
{ "FALSE", "FALSE" },
};

public Object[][] getContents() {
return contents;
}
}

JSP code is as follows:

<fmt:bundle basename="com.controller.messages.ControllerMessages"/>
<fmt:message key="CE"/>
<fmt:message key="OSE"/>
...

When I run the above JSP, it displays:

???CE??? - instead of "Content Engine"
???OSE??? - instead of "Object store exists"

___________________________________________________________

Even when I run the JSP examples from Tomcat, it displayed ???greeting_message???, I mean it displays the key with surrounding ???

Can you please tell me why I am not getting the value from the resource bundle?? I use java classes instead of properties files.

Thank you for your reply.

Kind regards
Kris
 
This will take every ounce of my mental strength! All for a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic