• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Cannot find message resources ?  RSS feed

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am getting the following error.. while running a simple application in struts.

Cannot find message resources under key org.apache.struts.action.MESSAGE ?

As I have searched in google but could not find the concreate example
so please help and give me a proper answer..

my struts-config.xml file is as .....

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>

<!-- ========== Form Bean Definitions ============ --> <form-beans> <form-bean name="login" type="test.struts.LoginForm" /> </form-beans> <!-- ========== Global Forward Definitions ========= --> <global-forwards> </global-forwards> <!-- ========== Action Mapping Definitions ======== --> <action-mappings> <action path="/login" type="test.struts.LoginAction" name="login" input="/jsp/LoginView.jsp" validate="true"> <forward name="valid" path="/jsp/MainMenu.jsp" /> <forward name="invalid" path="/jsp/LoginView.jsp" /> </action> </action-mappings> <message-resources null="false" parameter="test.struts.MessageResources"/>

</struts-config>

And my LoginView.jsp file is as:

<!-- LoginView.jsp -->
<%@ taglib uri="/struts/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/struts/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/struts/WEB-INF/struts-logic.tld" prefix="struts" %>
<HTML> <HEAD><TITLE>
<bean:message key="title.login" />
</TITLE></HEAD> <BODY>
<bean:message key="heading.login" />
<html:errors />
<html:form action="/login">
<bean:message key="label.userId" />:
<html:text property="userId" size="10" /> <br>
<bean:message key="label.passWord" />: <html assword property="passWord" size="10" /> <br><br> <html:submit> <bean:message key="button.submit" /> </html:submit> </html:form> </BODY> </HTML>

MessageResources.properties is as :

button.submit=Send for Verification error.no.userId=<li>User ID is a required field</li> error.no.passWord=<li>Password is a required field</li> error.invalid.login=<li>The User ID and/or Password are invalid. Please try again.</li> errors.footer=</ul><hr> errors.header=<h3><font color="red">Validation Error</font></h3>You must correct the following error(s) before proceeding:<ul> label.userId=User ID label.passWord=Password heading.login=<H2>Enter your user information</H2> title.login=Login Screen title.mainmenu=Welcome heading.mainmenu=<H1>Welcome!</H1> label.userType=<H2>You are authorized to use this system as a</H2>

Please reply soon.

Thanks in advance
 
Ranch Hand
Posts: 765
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Save your ApplicationResources.properties file in WEB-INF/classes folder.

D:\YourProjectFolder\WebContent\WEB-INF\classes\ApplicationResurces.proprties.

Do not forget to give right path in strus-config re-start server.

Bye,
Viki.
[ January 09, 2006: Message edited by: Vikrama Sanjeeva ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!