Spring MVC /Roo - Request method 'GET' not supported

夙愿已清 提交于 2019-12-25 08:58:43

问题


@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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!