Spring MVC /Roo - 请求方法“GET”不支持
@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";
}
为什么这会给我 HTTP 状态 405 - url 不支持请求方法“GET”: http://本地主机:8080/twiter-roo/tusers/1?
@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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果这是控制器中的唯一代码,您可以尝试从类的顶部删除 @RequestMapping 注释吗?我认为这是多余的
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