jQuery in Action, 3rd edition
The moose likes Struts and the fly likes bean:message tag not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean:message tag not working" Watch "bean:message tag not working" New topic

bean:message tag not working

Conie Ooi
Ranch Hand

Joined: Jun 09, 2002
Posts: 31
Hi, I'm running struts on VAJ4.0. I'm having one problem which whenever I'm using <bean:message> in the jsp, the page cannot the loaded, but it works fine after I removed the tag. Do you have any idea in solving this problem?

Joined: Nov 13, 2000
Posts: 9
Make sure you have the "ApplicationResources.properties" file in the WEB-INF directory of your web application.
If you don't have one you can copy a model file from "struts-example.war".
If you have the file in correct directory,make sure it is referenced properly in struts-config.xml.
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
JavaRanch has a naming policy which is strictly enforced. Please read the policy and change your display name if you wish to continue posting here.
You can change your name

Matthew Phillips
Roger Graff
Ranch Hand

Joined: May 29, 2001
Posts: 112
Be sure to import the bean tag-library in your JSP.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

The actual location of the ApplicationResource.properties file is in your webapp's classpath - under WEB-INF/classes if it's a freestanding file or in a jar file in WEB-INF/lib.
The complete pathname (freestanding file version) is synthesized from:

where <path-to-app-resources> is taken from the web.xml file underneath the <servlet> stanza for the ActionServlet:

To see everything in its proper context, look at the sample at http://localhost/strutsdemo/src/web.xml
Just for the sake of completeness, BTW, the sample Application Resources file is /tomcat3/webapps/strutsdemo/WEB-INF/classes/com/mousetech/strutsdemo/ApplicationResources.properties
Or, for Windows fans:
And, as always, upper/lower case in the filenames is critical (Even though Windows doesn't think so, Java does).
[ August 02, 2002: Message edited by: Tim Holloway ]

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link: http://aspose.com/file-tools
subject: bean:message tag not working
It's not a secret anymore!