Hi,
I'm using roo 1.2.2
I have created a controller annotated with @RooWebScaffold(path = "cards", formBackingObject = Card.class), so I get methods like show, update, create etc generated
However, I which to customize
on the controller.Code:public String show(@PathVariable("id") Long id, Model uiModel) { ..
I simply did that by adding this method to my controller and removing
from the backing aj file, in this case CardController_Roo_Controller which seems to work.Code:@RequestMapping(value = "/{id}", produces = "text/html") public String CardController.show(@PathVariable("id") Long id, Model uiModel) { uiModel.addAttribute("card", Card.findCard(id)); uiModel.addAttribute("itemId", id); return "cards/show"; }
If I would remove the create method, I could have done it using the annotation on the controller, like
So is the above the correct way to create a custom version of the show method.Code:@RooWebScaffold(path = "cards", formBackingObject = Card.class,create=false)
Best Regards
Niels


Reply With Quote