Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ftm:message not finding bundle

843836Oct 28 2004 — edited Oct 29 2004
Ok, I have a messages.properties file in WEB-INF/classes. I have this in my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.4"
    xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

  <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>messages</param-value>
  </context-param>

   ...
</web-app>
I got the lastest standard-1.1 from jakarta-taglibs, put standard.jar and jstl.jar into my WEB-INF/lib. I have a JSP page like this:
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

...

<fmt:setBundle var="messages" basename="messages"/>
  <p><fmt:message key="gateway.head.title" bundle="${messages}"/></p>
  <p><fmt:message key="gateway.head.title"/></p> 
The first fmt:message prints out the value from my bundle, but the second one just prints ???gateway.head.title???. Tried it on Tomcat 5.0.28 and Resin 3.0.9, J2SE 1.4.2 on Win XP Pro SP2. Why doesn't the 2nd fmt:message work? If I just take out the fmt:setBundle and the 1st fmt:message, the fmt:message by itself doesn't work, prints ???gateway.head.title???
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 26 2004
Added on Oct 28 2004
2 comments
202 views