Hi Thanks for the reply Stan. After two and a half days at this I finally figured out the problem, and cannot believe it was so simple. It was all down to a typo, I called the file ApplicationRersources.properties instead of ApplicationResources.properties. Of course when I glanced at it to check, it looks correct.
It was only when I went through the code, and in the loadLocale() method, the method call to this.getClass().getClassLoader().getResourceAsStream(name) was returning null, I knew what name was, and at that point decided to take a hard look at the file name to discover it was my fault all along. Thanks all anyway, I must be more careful next time! Shaun. ----- Original Message ----- From: "Stan Baranek" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Sent: Monday, July 22, 2002 3:56 PM Subject: Re: Missing message for key - problem with ApplicationResources? > 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.Pr o > > > > > >>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(Messag e > > > > > >ResourcesConfig[factory=org.apache.struts.util.PropertyMessageResourcesFact o > > > > > >>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 > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

