Announcement Announcement Module
Collapse
No announcement yet.
how to fix errors after push-in refactor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • how to fix errors after push-in refactor

    STS 2.9, Roo 1.2

    I made push-in refactor to move update method into java class.
    Final code is as follows:
    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);
        }
    }
    noteService is in NoteServiceImpl, but there is also error (second line from bottom)
    Also STS complaints it can not find populateEditForm and so on (strings in red).. How to fix it?
Working...
X