Formatted the code
This commit is contained in:
parent
c3d7000ff1
commit
8434f826e6
@ -12,7 +12,7 @@
|
||||
<body>
|
||||
<h3>Welcome, Enter The Employee Details</h3>
|
||||
|
||||
<form:form method="POST" action="/SpringMVCFormExample/addEmployee"
|
||||
<form:form method="POST" action="/spring-mvc-forms/addEmployee"
|
||||
commandName="employee">
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -1,9 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5">
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
|
||||
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5">
|
||||
<javaee:display-name>SpringMVCFormExample</javaee:display-name>
|
||||
<servlet>
|
||||
<servlet-name>dispatcher</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet
|
||||
</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
|
@ -21,8 +21,7 @@ public class EmployeeController {
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/addEmployee", method = RequestMethod.POST)
|
||||
public String submit(@Valid @ModelAttribute("employee")Employee employee, BindingResult result,
|
||||
ModelMap model) {
|
||||
public String submit(@Valid @ModelAttribute("employee") Employee employee, BindingResult result, ModelMap model) {
|
||||
if (result.hasErrors()) {
|
||||
return "error";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user