私は春が初めてで、やるべき仕事を与えられています。spring mvc を使用して従業員用の簡単な登録フォームを作成しましたが、その結果は別の jsp ページに表示されますが、フォームに入力した同じ jsp ページに結果を表示し、結果も表形式にする必要があります.
転送オプションとリダイレクト オプションも試しましたが、結果が得られません。
ここに私のファイルがあります:
EmployeeFormController.java
public class EmployeeFormController extends SimpleFormController {
@Override
protected ModelAndView onSubmit(Object command)
throws ServletException {
Employee employee = (Employee) command;  
ModelAndView modelAndView = new ModelAndView("usersuccess");
modelAndView.addObject("employee", employee);
return modelAndView;  
}  
}
user.jsp
    <%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
    <%@ taglib prefix="spring" uri="/spring"%>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"           "http://www.w3.org/TR/html4/loose.dtd">
   <html>
   <head>
   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Employee Personal Details</title>
   </head>
   <body>
   <center> <h3>Employee Personal Details</h3>
   <br/>
   <form:form commandName="user" method="POST" name="user">
   <table border="0">
   <tr>
   <td>Name:</td>
   <td><form:input path="name"/></td>
   <td><font color="red"><form:errors path="name"/></font></td>
   </tr>
   <tr>
   <td>Email ID:</td>
   <td><form:input path="emailid"/></td>
   <td><font color="red"><form:errors path="emailid"/></font></td>
    </tr>
  <tr>
 <td>Date of birth:</td>
 <td><form:input path="dob"/></td>
<td><font color="red"><form:errors path="dob"/></font></td>
</tr>
<tr>
<td>Qualification:</td>
<td><form:input path="qualification"/></td>
<td><font color="red"><form:errors path="qualification"/></font></td></tr>
<tr>
<td>Contact Number:</td>
<td><form:input path="contact"/></td>
<td><font color="red"><form:errors path="contact"/></font></td>
</tr> 
<tr>
<td>Address:</td>
<td><form:input path="address"/></td>
<td><font color="red"><form:errors path="address"/></font></td>
</tr>
<tr> 
<td colspan="3" align="center"><input type="submit" value="Save"/></td> 
</tr>
</table>
</form:form>
</center> 
</body>
</html>
ユーザー成功.jsp
<table border = 2>
<tr>
<td colspan="2" align="center"><font size="5">Employee Information</font></td> 
</tr>
<tr>
<td>Name:</td>
<td><core:out value="${employee.name}"/></td> 
</tr>
<tr>
<td>Email ID:</td>
<td><core:out value="${employee.emailid}"/></td> 
</tr>
<tr>
<td>Date Of Birth:</td>
<td><core:out value="${employee.dob}"/></td> 
</tr>
<tr>
<td>Qualification:</td>
<td><core:out value="${employee.qualification}"/></td> 
</tr>
<tr>
<td>Contact Number:</td>
<td><core:out value="${employee.contact}"/></td> 
</tr>
<tr>
<td>Address:</td>
<td><core:out value="${employee.address}"/></td> 
</tr>
</table>
dispatcher-servlet.xml
<bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/jsp/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<bean id="userController" class="com.web.EmployeeFormController">
<property name="sessionForm"><value>false</value></property>
<property name="commandName"><value>user</value></property>
<property name="commandClass"><value>com.web.Employee</value></property>
<property name="formView"><value>user</value></property>
<property name="successView"><value>usersuccess</value></property>
</bean>