org.apache.jasper.JasperException:在第33行处理JSP页面/WEB-INF/jsp/admissionForm.jsp时发生异常
在第33行获取错误。我是Spring MVC的新手,无法弄清楚这个错误 :
30: <table>
31: <tr>
32: <td>Customer Name :</td>
33: <td><form:input path="studentName" /></td>
34: <td><form:errors path="studentName" cssClass="error" /></td>
35: </tr>
36: <tr>
模型类
@Entity
public class Student {
@NotEmpty
private String studentName;
@Size(min=2,max=43)
private String major;
private Long studentMobile;
private Date studentDOB;
private ArrayList<String> studentSkills;
private Address studentAddress;
}
控制器
@RequestMapping(value = "/admissionForm", method = RequestMethod.GET)
public ModelAndView addmissionForm(){
ModelAndView mv = new ModelAndView("admissionForm");
return mv;
}
@RequestMapping(value = "/submitAdmissionForm" , method = RequestMethod.POST)
public ModelAndView submitAdmissionForm(@Valid @ModelAttribute("student1") Student student1, BindingResult result){
if(result.hasErrors()){
ModelAndView model1 = new ModelAndView("admissionForm");
return model1;
}
ModelAndView mv = new ModelAndView("admissionSuccess");
return mv;
}
JSP
<h2> SignUp Form - JSR303 @Valid example</h2>
<form:form method="POST" modelAttribute="student1" action="/submitAdmissionForm">
<form:errors path="*" cssClass="errorblock" element="div" />
<table>
<tr>
<td>Customer Name :</td>
<td><form:input path="studentName" /></td>
<td><form:errors path="studentName" cssClass="error" /></td>
</tr>
<tr>
<td>Customer Age :</td>
<td><form:input path="major" /></td>
<td><form:errors path="major" cssClass="error" /></td>
</tr>
<tr>
<td colspan="3"><input type="submit" /></td>
</tr>
</table>
</form:form>