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