wood burning stoves*
The moose likes Struts and the fly likes Cannot find message resources ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot find message resources ?" Watch "Cannot find message resources ?" New topic
Author

Cannot find message resources ?

harish pathak
Ranch Hand

Joined: Dec 17, 2005
Posts: 51
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
Vikrama Sanjeeva
Ranch Hand

Joined: Sep 02, 2001
Posts: 756
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 ]

Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining http://groups.yahoo.com/group/IBM340Exam/
 
 
subject: Cannot find message resources ?
 
Similar Threads
Struts Problem in the March Article
Javascript and Struts validator
Very basic question
Error while trying NewsLetter Example
what does .do file extension indicate