STS 2.9, Roo 1.2
I made push-in refactor to move update method into java class.
Final code is as follows:
noteService is in NoteServiceImpl, but there is also error (second line from bottom)Code:@RequestMapping("/notebooks") @Controller @RooWebScaffold(path = "notebooks", formBackingObject = Notebook.class) public class NotebookController { @Autowired private NoteService noteService; @RequestMapping(method = RequestMethod.PUT, produces = "text/html") public String update(@Valid Notebook notebook, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { if (bindingResult.hasErrors()) { populateEditForm(uiModel, notebook); return "notebooks/update"; } uiModel.asMap().clear(); notebookService.updateNotebook(notebook); noteService.updateNotesWithNoteBook(notebook); return "redirect:/notebooks/" + encodeUrlPathSegment(notebook.getId().toString(), httpServletRequest); } }
Also STS complaints it can not find populateEditForm and so on (strings in red).. How to fix it?


Reply With Quote