问题
@RequestMapping(value = "/tusers")
@Controller
@RooWebScaffold(path = "tusers", formBackingObject = TUser.class)
public class UserController {
@RequestMapping(value = "/tusers/{id}", produces = "text/html", method = RequestMethod.GET)
public String show(@PathVariable("id") Long id, Model uiModel) {
uiModel.addAttribute("object", tUserService.findTUser(id));
uiModel.addAttribute("itemId", id);
return "tusers/show";
}
Why does this give me HTTP Status 405 - Request method 'GET' not supported on url: http://localhost:8080/twiter-roo/tusers/1 ?
回答1:
If that is the only code in the controller, can you try and remove the @RequestMapping annotation from the top of the class? I think it is redundant
来源:https://stackoverflow.com/questions/9416908/spring-mvc-roo-request-method-get-not-supported