Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot find message resources ?  RSS feed

harish pathak
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" "">

<!-- ========== 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"/>


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" %>
<bean:message key="title.login" />
<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> is as :

button.submit=Send for Verification<li>User ID is a required field</li><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
Posts: 760
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Save your file in WEB-INF/classes folder.


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

[ January 09, 2006: Message edited by: Vikrama Sanjeeva ]
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!