Forums Register Login

The value is not displaying correctly in I18N

+Pie Number of slices to send: Send
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
Whip out those weird instruments of science and probe away! I think it's a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 885 times.
Similar Threads
Changed values aren't set on the backing object.
question on <fmt:message tag
Strange IllegalArgumentException: No bean specified
namespaces, rdf and forEach
Problem with JSTL fmt:setBundle tag
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:55:57.