This is my Update User Method:
@ResponseBody @Transactional @RequestMapping(value = "/profile/edit/{id}", method = RequestMethod.POST) public String updateUser(@PathVariable("id") final Integer id, String firstname, String lastname, final RedirectAttributes redirectAttributes) { respository.updateFirstname(id,firstname); respository.updateLastname(id, lastname); redirectAttributes.addFlashAttribute("message", "Successfully changed.."); return "redirect:/profile"; } All worked fine. Also the update in the Database. But the redirect is just a String and do not change the Path. Can someone tell me why?
@ResponseBody. Also it is a terrible idea to make your controller transactional... You should have a service which is transactional boundary (so that you can reuse that stuff).