I'm getting the following error when I first bring up my web app and I cannot trace down where the culprit is. I've triple checked my Action Form properties to ensure I'm following the "bean law" but I can't uncover where the error may be ocurring. Any suggestions would be greatly appreciated (I've narrowed down the code as much as I could):
Error:
org.apache.jasper.JasperException: Cannot retrieve definition for form bean loginForm on action /validateLogin
struts-config.xml:
<struts-config>
<form-beans>
<form-bean>name="loginForm" type="com.product.form.LoginForm"</form-bean>
</form-beans>
<action-mappings>
<action path="/displayLogin"
forward="/WEB-INF/jsp/displayLogin.jsp">
</action>
<action path="/validateLogin"
name="loginForm"
type="com.product.action.ValidateLogin"
input="WEB-INF/jsp/displayLogin.jsp"
scope="request">
<forward name="success" path="WEB-INF/jsp/mainScreen.jsp"/>
<forward name="failure" path="WEB-INF/jsp/invalidLogin.jsp"/>
</action>
</action-mappings>
<message-resources parameter="ApplicationResources"/>
</struts-config>
Here's the
JSP page I'm trying to access (displayLogin.jsp):
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<html>
<body>
<h1 align="center"><B>Project X (with
Struts)</B></h1>
<html:errors/>
<html:form action="/validateLogin">
<table>
<tr><td>User Name:</td><td><html:text property="username"/></td></tr>
<tr><td>Password:</td><td><html

assword property="password"/></td></tr>
</table>
<center>
<html:submit> Login </html:submit>
</center>
</html:form>
</body>
</html>
and finally, here's the Action Form:
package com.product.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
public class LoginForm extends ActionForm {
private
String username;
private String password;
//Getters and Setters
public void setUsername (String username) {
this.username = username;
}
public String getUsername () {
return username;
}
public void setPassword (String password) {
this.password = password;
}
public String getPassword () {
return password;
}
//Override the validate method
public ActionErrors validate (ActionMapping mapping,
HttpServletRequest request) {
ActionErrors actionerrors = new ActionErrors();
if (username.equals("")) {
actionerrors.add("no.username", new ActionMessage("no.username"));
}
if (password.equals("")) {
actionerrors.add("no.password", new ActionMessage("no.password"));
}
return actionerrors;
} //End validate
} //end LoginForm
Can anyone point me in the right direction. Oh yeah, my environment is run of the mill: WindowsXP,
Tomcat 5, Struts 1.1
Thanks in advance,
Scott