Shaun Whyte wrote:

>Hi
>
>Thanks for the tip, unfortunately I tried this already and I got the same
>problem.  As far as I understand, Struts 1.0 has the ApplicationRsources
>defined in the web.xml, but Struts 1.1 has it defined in the
>struts-config.xml, although someone please feel free to correct me if I'm
>wrong.
>
>Thanks again,
>Shaun.
>
>----- Original Message -----
>From: "srinivasa varadachar" <[EMAIL PROTECTED]>
>To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
>Sent: Friday, July 19, 2002 7:08 PM
>Subject: RE: Missing message for key - problem with ApplicationResources?
>
>
>  
>
>>hi,
>>
>>I don't know if you have entry in your web.xml file as shown below
>>
>><servlet>
>><servlet-name>action</servlet-name>
>>    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>>    <init-param>
>>      <param-name>application</param-name>
>>      <param-value>app.ApplicationResources</param-value>
>>    </init-param>
>>    ...
>>    ...
>>    ...
>></servlet>
>>
>>This works fine. You do not need any lines in the struts-config.xml file.
>>
>>Srini V
>>
>>
>>
>>-----Original Message-----
>>From: Shaun Whyte [mailto:[EMAIL PROTECTED]]
>>Sent: Friday, July 19, 2002 12:49 PM
>>To: [EMAIL PROTECTED]
>>Subject: Missing message for key - problem with ApplicationResources?
>>
>>
>>I am using the following:
>>- Apache Tomcat 4.0.4
>>- Struts 1.1 b1
>>
>>There seems to be a problem accessing my ApplicationResources.properties
>>file as it throws the following exception from the MessageTag when I call
>>the JSP page:
>>javax.servlet.jsp.JspException: Missing message for key prompt.ordersfrom
>>at
>>    
>>
>org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:298)
>  
>
>>This is being thrown from <bean:message key="prompt.ordersfrom"/> in my
>>    
>>
>jsp.
>  
>
>>In my struts-config.xml I have the line:
>><message-resources parameter="ApplicationResources"/>
>>
>>The ApplicationResources.properties file contains the keys it needs
>>(prompt.ordersfrom=xyz).
>>I have placed the ApplicationResources.properties file in the
>>/WEB-INF/classes directory within the webapp directory.
>>
>>I have placed the struts.jar file in the /WEB-INF/lib directory and have
>>ensured it is the only copy of struts.jar within tomcat.  I am using
>>    
>>
>xerces
>  
>
>>1.4 as my xml parser.
>>
>>I am using Log4j to log events and debug information, when the
>>    
>>
>ActionServlet
>  
>
>>is being initialised it gives the following output in the log:
>>2002-07-19 16:47:48,293 [ main] DEBUG
>>    
>>
>org.apache.commons.digester.Digester -
>  
>
>>[SetPropertiesRule]{struts-config/message-resources} Setting property
>>'parameter' to 'ApplicationResources'
>>2002-07-19 16:47:48,295 [ main] DEBUG
>>org.apache.commons.beanutils.BeanUtils -
>>
>>    
>>
>BeanUtils.populate(MessageResourcesConfig[factory=org.apache.struts.util.Pro
>  
>
>>pertyMessageResourcesFactorynull=true,parameter=null],
>>{parameter=ApplicationResources})
>>2002-07-19 16:47:48,296 [ main] DEBUG
>>org.apache.commons.beanutils.BeanUtils -   name='parameter',
>>value.class='java.lang.String', value='ApplicationResources'
>>2002-07-19 16:47:48,339 [ main] DEBUG
>>org.apache.commons.beanutils.ConvertUtils - Convert string
>>'ApplicationResources' to class 'java.lang.String'
>>2002-07-19 16:47:48,347 [ main] DEBUG
>>    
>>
>org.apache.commons.digester.Digester -
>  
>
>>[SetNextRule]{struts-config/message-resources} Call
>>
>>    
>>
>org.apache.struts.config.ApplicationConfig.addMessageResourcesConfig(Message
>  
>
>ResourcesConfig[factory=org.apache.struts.util.PropertyMessageResourcesFacto
>  
>
>>rynull=true,parameter=ApplicationResources])
>>
>>I am not entirely sure if it is correctly loading the ApplicationResources
>>properties file or not, as on the second line it has 'parameter=null', but
>>is this something to do with the factory?
>>
>>If anyone has any ideas why this is happening please let me know, as I'm
>>fast running out of them!
>>
>>Thanks, Shaun.
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail:
>><mailto:[EMAIL PROTECTED]>
>>
>>
>>--
>>To unsubscribe, e-mail:
>>    
>>
><mailto:[EMAIL PROTECTED]>
>  
>
>>For additional commands, e-mail:
>>    
>>
><mailto:[EMAIL PROTECTED]>
>  
>
>>
>>    
>>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>  
>
When I had this problem it was caused by not having the context set when 
using a subdirectory of the document home dir.  Is your .jsp in a 
sub-directory?  I had some junk in my header.jsp that was preventing it 
from finding where the base directory was that holds my resources file. 
 Try putting an image in the .jsp and see if it is able to traverse your 
./images directory.

Cheers,
Stan

Reply via email to