You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Darryl <da...@vis.co.za> on 2001/04/09 11:15:34 UTC

Bundle attribute for bean:message tag???

Hi all,

I'm wanting to use the <bean:message.../> tag in an application where
I'm not using the ActionServlet and therefore, not setting up the
servlet specs in my web.xml file. Currently when the JSP page executes
the <bean:message.../> tag it tells me:


     javax.servlet.jsp.JspException: Cannot find message resources
     under key org.apache.struts.action.MESSAGE


I thought I could fix the problem by specifying the bundle attribute of
the MessageTag class and setting it to the location in my
CLASSPATH where the properties file resides but it still doesn't find
the file. I have specified the file with a .properties extension and
double-checked that it is in my CLASSPATH at the specified location with
the name ApplicationResources.properties.

Any ideas? Anyone run into this before? I did search the messages I have
stored as well as scoured the Struts website but couldn't find anything
on this matter so I hope I'm not repeating something that was dealt with
previously.

thanks in advance,
Darryl


Re: Bundle attribute for bean:message tag???

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 9 Apr 2001, Darryl wrote:

> Hi all,
> 
> I'm wanting to use the <bean:message.../> tag in an application where
> I'm not using the ActionServlet and therefore, not setting up the
> servlet specs in my web.xml file. Currently when the JSP page executes
> the <bean:message.../> tag it tells me:
> 
> 
>      javax.servlet.jsp.JspException: Cannot find message resources
>      under key org.apache.struts.action.MESSAGE
> 
> 
> I thought I could fix the problem by specifying the bundle attribute of
> the MessageTag class and setting it to the location in my
> CLASSPATH where the properties file resides but it still doesn't find
> the file. I have specified the file with a .properties extension and
> double-checked that it is in my CLASSPATH at the specified location with
> the name ApplicationResources.properties.
> 
> Any ideas? Anyone run into this before? I did search the messages I have
> stored as well as scoured the Struts website but couldn't find anything
> on this matter so I hope I'm not repeating something that was dealt with
> previously.
> 
> thanks in advance,
> Darryl
> 
> 

If you want to use the <bean:message> tag, you will need to ensure that a
MessageResources instance is stored as a servlet context attribute under
key "org.apache.struts.action.MESSAGE".  This is what the controller
servlet does for you automatically for the application resources.  If you
don't want to use the controller servlet, you will need to create such an
object yourself.

Craig McClanahan