Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:message tag not working

 
Conie Ooi
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks
 
sbezawada
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2676
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sbezawada,
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
here
 
Roger Graff
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be sure to import the bean tag-library in your JSP.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
C:\tomcat3\webapps\strutsdemo\WEB-INF\classes\com\mousetech\strutsdemo\ApplicationResources.properties
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic