严重: Servlet.service() for servlet jsp threw exception
javax.servlet.jsp.JspException: Cannot retrieve definition for form bean userForm
查看映射文件struts-config.xml
<struts-config>
<data-sources />
<form-beans>
<form-bean name="UserForm" type="com.jspdev.ch17.UserForm"></form-bean>
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="userCreated" path="/viewUser.jsp"></forward>
</global-forwards>
<action-mappings>
<action path="/createUser"
type="com.jspdev.ch17.UserAction"
name="userForm"
scope="request"
validate="true"
input="/createUser.jsp"></action>
</action-mappings>
<message-resources parameter="ApplicationResources" />
</struts-config>
注意:<form-bean name="UserForm" type="com.jspdev.ch17.UserForm"></form-bean>
与 <action path="/createUser"
type="com.jspdev.ch17.UserAction"
name="userForm"
scope="request
这两个name的值必须相等
UserForm userForm注意区分大小写
javax.servlet.jsp.JspException: Cannot retrieve definition for form bean userForm
查看映射文件struts-config.xml
<struts-config>
<data-sources />
<form-beans>
<form-bean name="UserForm" type="com.jspdev.ch17.UserForm"></form-bean>
</form-beans>
<global-exceptions />
<global-forwards>
<forward name="userCreated" path="/viewUser.jsp"></forward>
</global-forwards>
<action-mappings>
<action path="/createUser"
type="com.jspdev.ch17.UserAction"
name="userForm"
scope="request"
validate="true"
input="/createUser.jsp"></action>
</action-mappings>
<message-resources parameter="ApplicationResources" />
</struts-config>
注意:<form-bean name="UserForm" type="com.jspdev.ch17.UserForm"></form-bean>
与 <action path="/createUser"
type="com.jspdev.ch17.UserAction"
name="userForm"
scope="request
这两个name的值必须相等
UserForm userForm注意区分大小写