I have the web scaffolding for an entity generated by roo. In the controller, I pushed in exactly one method
Note that the method in question is unchanged from the version generated by roo in the _Roo_Controller.aj aspect. I just added it to the java file and modified the declaration so that it was legal syntax for a java method.Code:@RooWebScaffold(path = "thermalspaces", formBackingObject = ThermalSpace.class) @RequestMapping("/thermalspaces") @Controller public class ThermalSpaceController { @RequestMapping(value = "/{id}", method = RequestMethod.GET) public String show(@PathVariable("id") Long id, Model uiModel) { uiModel.addAttribute("thermalspace", ThermalSpace.findThermalSpace(id)); uiModel.addAttribute("itemId", id); return "thermalspaces/show"; } }
I was getting the following warnings (or, at least, I took them to be warnings) when the roo shell initialized
I assumed that was just the roo shell telling me that it had found my version of the method so it was not generating the same thing in the aspect - and, indeed, the method was not generated. However, it was apparently preventing the shell from doing any further work when scanning the filesystem for changes - so roo completely stopped generating aspects for any of my domain entities - which were apparently processed after the web controller. And changes made to a domain entity were not reflected in the aspects generated by roo, so I could not modify toString methods, update the @RooEntity annotation, or even generate new entities via the roo shell. As soon as I commented out the controller method in the java file and re-launched the roo shell, the shell detected all of my changes and proceeded to re-generate everything as I had been expecting it to do.Code:Undo manage SRC_MAIN_WEBAPP/WEB-INF/i18n/application.properties Method 'show' already defined in target type 'com.company.web.ThermalSpaceController' (ITD target 'com.company.web.ThermalSpaceController_Roo_Controller')
So my question is - if I need to modify a web scaffold controller method so that I can add something else to the model, how can I do so without breaking my entire roo project?


Reply With Quote