Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Struts: Missing message for key...

Reply
Thread Tools

Struts: Missing message for key...

 
 
Darrin
Guest
Posts: n/a
 
      01-20-2004
I keep getting a "Missing message for key..." error. Here is what the
application setup is:

1) I have an ApplicationResources.properties file located here:
\WEB-INF\classes\com\company\product\appname\Applicatio nResources.properties

2) In my web.xml file I have the following entry:

<!-- Action Servlet Configuration -->
<servlet>
<servlet-name>appname</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>com.company.product.appname.ApplicationResou rces</param-value>
</init-param>



3) In that ApplicationResources.properties file I have the following:
image.company=Company Name

4) My .jsp that requests the key is in the top level directory (same
level as WEB-INF). In that file I have this:
img src="Company_Logo.gif" align="left" alt="<bean:message
key="image.company"/>"

When I try to load it, I get: Missing message for key "image.company"
javax.servlet.jsp.JspException: Missing message for key
"image.company" at org.apache.struts.taglib.bean.MessageTag.doStartTa g(MessageTag.java:297)
at...

This is driving me crazy! I've tried copying the Application.Resources
file to every directory I could think of but nothing helps.

What am I doing wrong? All I could find on the net is this:
The key-value pair with specified key is not in
ApplicationResources.properties file

or

ApplicationResources.properties file not in classpath (not in
WEB-INF/classes directory in specified location)

Well, it is specified, and it is in the classpath.

Someone please tell me what I'm doing wrong!

Thanks!
 
Reply With Quote
 
 
 
 
Sudsy
Guest
Posts: n/a
 
      01-21-2004
Darrin wrote:
> I keep getting a "Missing message for key..." error. Here is what the
> application setup is:
>
> 1) I have an ApplicationResources.properties file located here:
> \WEB-INF\classes\com\company\product\appname\Applicatio nResources.properties
>
> 2) In my web.xml file I have the following entry:
>
> <!-- Action Servlet Configuration -->
> <servlet>
> <servlet-name>appname</servlet-name>
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> <init-param>
> <param-name>application</param-name>
> <param-value>com.company.product.appname.ApplicationResou rces</param-value>
> </init-param>


You're missing the following, which should go in your struts-config.xml
file:
<message-resources null="true" parameter="ApplicationResources"/>

Make sure that you put it in the right place according to the TLD. It
should appear after the <controller> tag and before and <plug-in>s.

 
Reply With Quote
 
 
 
 
esaiesai esaiesai is offline
Junior Member
Join Date: Apr 2010
Posts: 1
 
      04-22-2010
Same issue I faced,....but then realized that the message resource file name should be mentioned in the web.xml with out the extension.

So, for example,

<servlet>
<servlet-name>action</servlet-name>
<servlet-class>com........AppControllerServlet</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>AppErrorMessages</param-value>
</init-param>

Here, "AppErrorMessages" should not be mentioned as "AppErrorMessages.properties".
 
Reply With Quote
 
ahil23 ahil23 is offline
Junior Member
Join Date: Jul 2011
Posts: 1
 
      07-21-2011
Tht's great...
Actually i was searching google for this error.
And after seeing the velocity Reviews i did the denoted things in the web.xml and struts-config.xml.
Now its working...
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal Reports - Visual Basic UFL that implements this function is missing (or U2lcom.dll is missing) Les Caudle ASP .Net 3 09-03-2007 02:27 AM
Re: missing feature classes and missing fields Gary Herron Python 2 07-04-2006 10:29 PM
Date missing from message headers Danny Colyer Firefox 2 04-25-2004 10:07 AM
Missing message bodies in newsgroup Ian Murphy ASP .Net 0 03-02-2004 09:05 AM
Re: RequiredFieldValidator doesn't show error message and missing __postback function Peter Blum ASP .Net 0 02-25-2004 11:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57