File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Badass: Making Users Awesome this week in the Game Development forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Cannot find message resources ?" Watch "Cannot find message resources ?" New topic

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

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

Joined: Sep 02, 2001
Posts: 756

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 ]

Count the flowers of your garden, NOT the leafs which falls away!
Prepare IBM Exam 340 by joining
I agree. Here's the link:
subject: Cannot find message resources ?