This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes javax servlet ServletException :  Missing message for key Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "javax servlet ServletException :  Missing message for key "app.symbol"" Watch "javax servlet ServletException :  Missing message for key "app.symbol"" New topic
Author

javax servlet ServletException : Missing message for key "app.symbol"

sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
hi
I am getting labels into jsp from properties file which is located in classess directory. first i addedd key and value pair in properties file as

app.symbol=Symbol

in jsp file iam retriving as

<td><bean:message key="app.symbol" />:</td>
<td><html:text property="symbol" /></td>

in web.xml iam specifying this as
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>

but iam getting the following Exception when iam requesting jsp in browser

javax.servlet.ServletException: Missing message for key "app.symbol"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.index_jsp._jspService(index_jsp.java:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


root cause

javax.servlet.jsp.JspException: Missing message for key "app.symbol"
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
org.apache.jsp.index_jsp._jspx_meth_bean_message_0(index_jsp.java:182)


and in log file


2006-05-25 12:40:57 StandardWrapperValve[jsp]: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Missing message for key "app.symbol"
at org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
at org.apache.jsp.index_jsp._jspx_meth_bean_message_0(index_jsp.java:182)
at org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:147)
at org.apache.jsp.index_jsp._jspService(index_jsp.java:99)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:31

need help
regards
saiprasanna
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Defining the resource bundle in web.xml is deprecated in later versions of Struts.

Try putting the following line in your struts-config.xml file:

<message-resources parameter="ApplicationResources"/>


Merrill
Consultant, Sima Solutions
sai prasanna
Ranch Hand

Joined: May 02, 2005
Posts: 167
Thanks Merrill
 
 
subject: javax servlet ServletException : Missing message for key "app.symbol"