Hi everyone,
I am getting the following exception when I try display the labels on my login page using the <spring:messages tag.
javax.servlet.jsp.JspTagException: No message found under code 'user.id' for locale 'en_NZ'.
org.springframework.web.servlet.tags.MessageTag.doStartTagInternal(MessageTag.java:183)
org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:77)
org.apache.jsp.jsp.login_jsp._jspx_meth_spring_005fmessage_005f1(login_jsp.java:286)
org.apache.jsp.jsp.login_jsp._jspService(login_jsp.java:131)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Login.jsp located in application/jsp
<td class="verbatimStyle" width="40%" align="right"> <spring:message
code="user.id" />: </td>
messages.properties located in web-inf/classes
user.id = User ID
spring.tld located in web-inf
<tag>
<name>message</name>
<tag-class>org.springframework.web.servlet.tags.MessageTag</tag-class>
<body-content>
JSP</body-content>
<description>
Retrieves the message with the given code, or text if code isn't resolvable.
The HTML escaping flag participates in a page-wide or application-wide setting
(i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml).
</description>
<attribute>
<name>message</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>A MessageSourceResolvable argument (direct or through JSP EL).</description>
</attribute>
<attribute>
<name>code</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>The code (key) to use when looking up the message.
If code is not provided, the text attribute will be used.</description>
</attribute>
<attribute>
<name>arguments</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>Set optional message arguments for this tag, as a
(comma-)delimited
String (each String argument can contain JSP EL),
an Object array (used as argument array), or a single Object (used
as single argument).</description>
</attribute>
<attribute>
<name>argumentSeparator</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>The separator character to be used for splitting the
arguments string value; defaults to a 'comma' (',').</description>
</attribute>
<attribute>
<name>text</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>Default text to output when a message for the given code
could not be found. If both text and code are not set, the tag will
output null.</description>
</attribute>
<attribute>
<name>var</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>The string to use when binding the result to the page,
request, session or application scope. If not specified, the result
gets outputted to the writer (i.e. typically directly to the JSP).</description>
</attribute>
<attribute>
<name>scope</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>The scope to use when exporting the result to a variable.
This attribute is only used when var is also set. Possible values are
page, request, session and application.</description>
</attribute>
<attribute>
<name>htmlEscape</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>Set HTML escaping for this tag, as boolean value.
Overrides the default HTML escaping setting for the current page.</description>
</attribute>
<attribute>
<name>javaScriptEscape</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<description>Set JavaScript escaping for this tag, as boolean value. Default is false.</description>
</attribute>
</tag>
<application>-servlet.xml
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<property name="basename">
<value>messages</value>
</property>
</bean>
<bean id="simpleUrlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"
singleton="true">
<property name="mappings">
<props>
<prop key="/login.do">loginController</prop>
</props>
</property>
</bean>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
singleton="true">
<property name="viewClass">
<value>org.springframework.web.servlet.view.JstlView</value>
</property>
<property name="prefix">
<value>/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
Server:
Tomcat 6.0
jdk1.6.0_15
Spring.jar
Manifest-Version: 1.0
Ant-Version: Apache
Ant 1.6.5
Created-By: 1.5.0_08-b03 (Sun Microsystems Inc.)
Implementation-Title: Spring Framework
Implementation-Version: 2.0
Spring-Version: 2.0
Premain-Class: org.springframework.instrument.InstrumentationSavingAgent
I am not sure where am I going wrong.
Anyone please help me fix this issue.
Many thanks
Kavitha