Thanks, rlubke.
faces-config.xml:
<faces-config>
<managed-bean>
<managed-bean-name>entrance</managed-bean-name>
<managed-bean-class>
example.Entrance
</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
<navigation-rule>
<from-view-id>/entrance.jsp</from-view-id>
<navigation-case>
<from-outcome>success</from-outcome>
<to-view-id>/ok.jsp</to-view-id>
<redirect/>
</navigation-case>
</navigation-rule>
</faces-config>
entrance.jsp:
<%@taglib uri="
http://java.sun.com/jsf/html" prefix="h"%>
<%@taglib uri="
http://java.sun.com/jsf/core" prefix="f"%>
<html>
<body>
<f:view>
<f:loadBundle basename="msg" var="msg" />
<h1>TEST</h1>
<h:form>
<h:outputText value="#{msg.keyword_required}" />
<h:inputText id="keyword" value="#{entrance.keyword}" required="true"
requiredMessage="#{msg.keyword_required}" />
<h:commandButton id="submit" action="#{entrance.search}"
value="#{msg.search}" />
<h:message for="keyword" />
</h:form>
</f:view>
</body>
</html>
web.xml:
<web-app xmlns="
http://java.sun.com/xml/ns/javaee"
xmlns:j2ee="
http://java.sun.com/xml/ns/javaee"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" version="2.5"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
</web-app>
You can see "KEYWORD REQUIRED" at h:outputText but cannot see at h:message. Moreover, you can see "FOO" at h:message.
[Message sent by forum member 'nakamurakenichi' (nakamurakenichi)]
http://forums.java.net/jive/thread.jspa?messageID=226807