You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeff Schnitzer <je...@infohazard.org> on 2001/03/08 17:01:07 UTC

RE: Cannot find message resources underkeyorg.apache.struts.action.MESSAGE

I still don't understand why you need to store anything more than the
Locale in the user's session.  When you want a resource, you call:

String message = ResourceBundle.getBundle(resourceName, locale,
classLoader).getString(key);

And you get your message.  Why more complexity?

Jeff

>-----Original Message-----
>From: Martin Cooper [mailto:martin.cooper@tumbleweed.com]
>Sent: Wednesday, March 07, 2001 5:07 PM
>To: struts-user@jakarta.apache.org
>Subject: Re: Cannot find message resources
>underkeyorg.apache.struts.action.MESSAGE
>
>
>In a word, internationalization. (OK, it's a very long word! :-) )
>
>Different users may be running in different locales, so the message
>resources need to be stored on a per-user basis.
>
>--
>Martin Cooper
>
>----- Original Message -----
>From: "Jeff Schnitzer" <je...@infohazard.org>
>To: <st...@jakarta.apache.org>
>Sent: Sunday, March 04, 2001 11:12 PM
>Subject: RE: Cannot find message resources under
>keyorg.apache.struts.action.MESSAGE
>
>
>The next logical question is then:  Why does Struts store resources in
>the session (actually, servlet context)?  What is wrong with using the
>static cache that ResourceBundle maintains?  Since each web application
>should have its own classloader, there shouldn't be any risk of
>conflict.
>
>Thanks,
>Jeff Schnitzer
>jeff@infohazard.org
>
>>-----Original Message-----
>>From: Martin Cooper [mailto:martin.cooper@tumbleweed.com]
>>Sent: Sunday, March 04, 2001 7:21 PM
>>To: struts-user@jakarta.apache.org
>>Subject: Re: Cannot find message resources under
>>keyorg.apache.struts.action.MESSAGE
>>
>>
>>> Why does struts eschew the ResourceBundle for a homebrew framework?
>>
>>The problem, as I understand it, boils down to the fact that
>>ResourceBundle
>>does not implement Serializable.
>>
>>Struts stores application resources in the session. However,
>>some containers
>>require that objects stored in the session implement
>>Serializable in order
>>for the web app to be distributable. Since ResourceBundle does
>>not meet this
>>requirement, a new implementation was constructed which does.
>>(Originally,
>>Struts did indeed use ResourceBundle for its resources.)
>>
>>--
>>Martin Cooper
>>
>>
>>----- Original Message -----
>>From: "Jeff Schnitzer" <je...@infohazard.org>
>>To: <st...@jakarta.apache.org>
>>Sent: Saturday, March 03, 2001 3:59 AM
>>Subject: RE: Cannot find message resources under key
>>org.apache.struts.action.MESSAGE
>>
>>
>>The problem is that the Orion classloader does not implement
>>getResourceAsStream().  It's been logged in Orion's bugzilla.
>>
>>There are workarounds posted in the struts-user and orion-interest
>>archives, mostly involving packaging the application in funny ways.
>>Yuck.
>>
>>This was a brief conversation on the Orion list, but it's 
>probably more
>>appropriate here:
>>
>>Why does struts eschew the ResourceBundle for a homebrew framework?
>>
>>Jeff
>>
>>>-----Original Message-----
>>>From: G.L. Grobe [mailto:gary@grobe.org]
>>>Sent: Saturday, March 03, 2001 1:27 AM
>>>To: struts-user@jakarta.apache.org
>>>Subject: Cannot find message resources under key
>>>org.apache.struts.action.MESSAGE
>>>
>>>
>>>Just started learning struts. I'm using orion server 1.4.5.
>>>I've got the
>>>struts.jar in my ~/WEB-INF/lib dir and have listed the taglibs in the
>>>~/WEB-INF/web.xml file as well as included all the *.tld in
>>>this same dir.
>>>  <taglib>
>>>      <taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
>>>      <taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
>>>   </taglib>
>>>
>>>   <taglib>
>>>      <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
>>>      <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
>>>   </taglib>
>>>...
>>>
>>>When running the following page, I get the error list down below:
>>>I've also got a file called 'myProps.properties' packaged under the
>>>~/WEB-INF/classes/com.mydir1/mydir2/resources dir.
>>>
>>>-------- index.jsp -----------------------------------
>>><%@ page language="java" %>
>>><%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>>><%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>>>
>>><html:html>
>>><head>
>>><title>
>>>   <bean:message key="main.title" />
>>></title>
>>></head>
>>>
>>><body>
>>><html:errors />
>>>
>>>This is a atest.
>>></body>
>>></html:html>
>>>
>>>----------- error output -------------------------
>>>
>>>500 Internal Server Error
>>>javax.servlet.jsp.JspException: Cannot find message resources
>>under key
>>>org.apache.struts.action.MESSAGE at
>>>org.apache.struts.util.RequestUtils.message(RequestUtils.java,
>> Compiled
>>>Code) at
>>>org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java,
>>>Compiled Code) at /index.jsp._jspService(/index.jsp.java,
>>>Compiled Code) at
>>>com.orionserver.http.OrionHttpJspPage.service(JAX, Compiled Code) at
>>>com.evermind.server.http.HttpApplication.xj(JAX, Compiled Code) at
>>>com.evermind.server.http.JSPServlet.service(JAX, Compiled Code) at
>>>com.evermind.server.http.d3.sw(JAX, Compiled Code) at
>>>com.evermind.server.http.d3.su(JAX, Compiled Code) at
>>>com.evermind.server.http.ef.s1(JAX, Compiled Code) at
>>>com.evermind.server.http.ef.do(JAX, Compiled Code) at
>>>com.evermind.util.f.run(JAX, Compiled Code)
>>>
>>>
>>>Any help much appreciated.
>>>
>>>
>>
>>
>>
>
>
>