Removing HTML media type
This commit is contained in:
parent
9b0682b2fb
commit
b9c58d69bc
@ -30,15 +30,6 @@ public class EmployeeController {
|
|||||||
return employeeMap.get(Id);
|
return employeeMap.get(Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/employee/{Id}", method = RequestMethod.GET)
|
|
||||||
public String getEmployeeByIdHtmlView(@PathVariable final long Id, final ModelMap model) {
|
|
||||||
model.addAttribute("name", employeeMap.get(Id).getName());
|
|
||||||
model.addAttribute("contactNumber", employeeMap.get(Id).getContactNumber());
|
|
||||||
model.addAttribute("id", employeeMap.get(Id).getId());
|
|
||||||
|
|
||||||
return "employeeView";
|
|
||||||
}
|
|
||||||
|
|
||||||
@RequestMapping(value = "/addEmployee", method = RequestMethod.POST)
|
@RequestMapping(value = "/addEmployee", method = RequestMethod.POST)
|
||||||
public String submit(@ModelAttribute("employee") final Employee employee, final BindingResult result, final ModelMap model) {
|
public String submit(@ModelAttribute("employee") final Employee employee, final BindingResult result, final ModelMap model) {
|
||||||
if (result.hasErrors()) {
|
if (result.hasErrors()) {
|
||||||
@ -47,9 +38,7 @@ public class EmployeeController {
|
|||||||
model.addAttribute("name", employee.getName());
|
model.addAttribute("name", employee.getName());
|
||||||
model.addAttribute("contactNumber", employee.getContactNumber());
|
model.addAttribute("contactNumber", employee.getContactNumber());
|
||||||
model.addAttribute("id", employee.getId());
|
model.addAttribute("id", employee.getId());
|
||||||
|
|
||||||
employeeMap.put(employee.getId(), employee);
|
employeeMap.put(employee.getId(), employee);
|
||||||
|
|
||||||
return "employeeView";
|
return "employeeView";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user