///////////////////////////////////////////////////////////////////////// get
///////////////////////////////////////////////////////////////////////// employee
///////////////////////////////////////////////////////////////////////// no to
///////////////////////////////////////////////////////////////////////// update
@RequestMapping(value = "/editemp/{id}")
public String edit(@PathVariable int id, Model model) {
model.addAttribute("employee", emloyeeService.findEmpById(id));
return "empedit";
}
obigen Code zu Mitarbeiterdaten von id zu bearbeiten und es funktioniert dies url http://localhost:9090/springwebjdbctemplate/editemp/2
@RequestMapping(path = "/getallemp", method = RequestMethod.POST)
public String edit(@Valid Employee employee, BindingResult bindingResult) {
if (bindingResult.getErrorCount() > 0) {
return "empedit";
} else {
emloyeeService.updateEmpData(employee);
return "redirect:/allemp";
}
Ausnahme tritt hier auf, wenn ich es versuche modifizierten Daten zu speichern und die Anforderung an „allEmp.jsp“ Seite diese URL ist http://localhost:9090/springwebjdbctemplate/editemp/getallemp Ich denke, das Problem in URL umleiten sollte es http://localhost:9090/springwebjdbctemplate/getallemp statt über url
ja das Problem war in URL in "