Hello everyone,
I am trying to write a very simple Struts application that simply displays a JSP using
bean:message to retrieve values for my field labels and buttons from a ResourceBundle.
Pretty straight forward, but I am getting the following error:
[exec] javax.servlet.jsp.JspException: Cannot retrieve definition for form
bean null
The message seems to imply that Struts is trying to access a bean whose name is "null"
but I don't know what bean that would be as I have no beans referenced on my JSP. I am
only trying to invoke the logic contained within the struts-bean.tld.
The logic flow is the user signs-into the application and is then forwarded to
"simplePage.jsp". I used a ForwardAction to navigate from the logon page (after a
successful login). But I never reach "simplePage.jsp" due to the above mentioned error.
Any help would be appreciated.
Here is what I have in my struts_config.xml:
<struts-config>
<form-beans>
<form-bean name="simpleForm" type="com.company.simpleForm"/>
<form-bean name="logonForm" type="com.company.LogonForm"/>
</form-beans>
<global-forwards type="org.apache.struts.action.ActionForward">
<forward name="logoff" path="/Logoff.do"/>
<forward name="logon" path="/Logon.do"/>
<forward name="welcome" path="/Welcome.do"/>
</global-forwards>
<action-mappings>
<action path="/Welcome" type="org.apache.struts.actions.ForwardAction"
parameter="Welcome.jsp"/>
<action path="/Logon" type="org.apache.struts.actions.ForwardAction"
parameter="Logon.jsp"/>
<action path="/LogonSubmit" type="com.company.LogonAction" name="logonForm"
scope="request" validate="true" input="Logon.jsp">
<forward name="success" path="simplePage.jsp"/>
</action>
<action path="/Logoff" type="LogoffAction">
<forward name="success" path="Welcome.jsp"/>
</action>
<action path="/simplePage" type="org.apache.struts.actions.ForwardAction"
parameter="simplePage.jsp"/>
</action-mappings>
</struts-config>
Here is my JSP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<head>
<link rel="stylesheet" href="include/format.css" type="text/css"/>
</head>
<title>
<html:base/>
<bean:message key="simplePage.title"/>
</title>
<body>
</body>
</html:html>
---------------------------------
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day