JSP的代码是下面这样的:<FONT color=darkgreen><H3>Application Leave</H3></FONT><%@ include file="IncludeTop.jsp" %>
<%@ taglib prefix="html" uri="http://jakarta.apache.org/struts/tags-html" %><table align="left" bgcolor="#008800" border="0" cellspacing="2" cellpadding="2">
<tr><td bgcolor="#FFFF88">
<a href="<c:url value="/shop/index.do"/>"><b><font color="BLACK" size="2"/><< Main Menu</font></b></a>
</td></tr>
</table><p>
<center>
  <h2><c:out value="${category.name}"/></h2>
  </center>
  <html:form styleId="applicationLeaveForm" method="post" action="/shop/applicationleave.do?action=newleave">    //第16行<TABLE bgcolor="#008800" border=0 cellpadding=3 cellspacing=1 bgcolor="#FFFF88">
<TR bgcolor="#FFFF88"><TD>
Applicant :</TD><TD><html:text name="applicationLeaveForm" property="leave.applicant" />
</TD></TR>
<TR bgcolor="#FFFF88"><TD>
Application Date:</TD><TD><html:text size="40" name="applicationLeaveForm" property="leave.applicationDate" />
</TD></TR>
<TR bgcolor="#FFFF88"><TD>
Reason:</TD><TD><html:text size="40" name="applicationLeaveForm" property="leave.reason" />
</TD></TR>
<TR bgcolor="#FFFF88"><TD>
<tr><td>Manager : </td>
  <td>
   <html:select name="applicationLeaveForm" property="agreeStatus">
   <html:options collection="agreeStatusList" property="dictValue" labelProperty="dictLabel" />
</html:select>
</td></tr>
<tr><td>General Manager : </td>
  <td>
   <html:select name="applicationLeaveForm" property="agreeStatus">
   <html:options collection="agreeStatusList" property="dictValue" labelProperty="dictLabel" />
</html:select>
</td></tr>  <tr><td></td><td><input border=0 type="image" src="../images/button_submit.gif" /></td></tr>
</table>
</html:form>
<%@ include file="IncludeBottom.jsp" %></p></p>我在页面上点链接后MyEclipse报错提示JSP中第16行有问题,报错内容如下:
javax.servlet.jsp.JspException:Cannot retrieve definition for form bean applicationLeaveForm on action /shop/applicationleave.do?action=newleave请问是我JSP页面里面语法有问题还是哪出错了?

解决方案 »

  1.   

    applicationLeaveForm 说是检索不到这个formbean啊,你有没有这个formbean啊,或者关联到action里去了没
      

  2.   

    怎么会找不到呢,我在struts-config.xml里面设置了啊,如下:
    <action path="/shop/applicationleave" type="org.springframework.samples.jpetstore.web.struts.ApplicationLeaveAction"
    name="applicationLeaveForm" scope="session" validate="false">
    <forward name="success" path="/WEB-INF/jsp/struts/ApplicationLeave.jsp"/>
    </action>
    后面的ApplicationLeaveAction也设置了啊
      

  3.   

    applicationLeaveForm这个你配置了吗
      

  4.   

    知道了,原来是struts-config.xml里面没有加上一行
    <form-bean name="applicationLeaveForm" type="org.springframework.samples.jpetstore.web.struts.ApplicationLeaveForm"/>