无法检索表单bean的定义

时间:2014-03-23 15:03:47

标签: java jsp java-ee struts-1

我的jsp页面出现以下错误:

org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Cannot retrieve definition for form bean myLoginForm
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:535)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)


org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:455)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.dps.onlineAdmissions.util.LoginFilter.doFilter(LoginFilter.java:57)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

我在struts-config.xml中的表单bean是:

<form-beam name="myLoginForm" type="com.dps.onlineAdmissions.form.MyLoginForm" />

我的操作标记是:

<action type="com.dps.onlineAdmissions.action.MyLogin" path="/MyLogin" 
             name="myLoginForm" validate="true" input="/Index2.jsp" scope="request">

        <forward name="newUser" path="/welcome.jsp" />
        <forward name="validUser" path="/welcome.jsp" />
        <forward name="loginPage" path="/login.jsp" />
        <forward name="newApp" path="/newApplication.do" />
        <forward name="migrateStudent" path="/LoginByPassAction.do" />
        <forward name="selectProg" path="/selectProgram.jsp" />
    </action>

我试图在几个小时内解决错误但是没有取得任何成功。 导致此错误的原因是什么,我该如何解决?

谢谢!

1 个答案:

答案 0 :(得分:2)

应该是

<form-beans>
<form-bean name="myLoginForm" type="com.dps.onlineAdmissions.form.MyLoginForm"/>
</form-beans>

标签中不是form-beam。纠正拼写错误