SpringMVC

来源:互联网 发布:淘宝贷款15万交3000 编辑:程序博客网 时间:2024/05/29 11:39

问题描述:

请求路径(无错):http://localhost:8080/lims-core/service/tms/template/addBean

但服务器端提示错误(与请求路径不一样):

WARN 2017-08-04 18:21:31.009 283963972@qtp-24300138-1 [PageNotFound:1176] - No mapping found for HTTP request with URI [/lims-core/service/tms/template/tms/template/addBean] in DispatcherServlet with name 'rest'

可见,/tms/template重复了两次,而它正是Controller的RequestMapping值:

@Controller("templateRESTService")@RequestMapping("/tms/template")

而/addBean 为方法映射路径:

//@ResponseBody@RequestMapping(method=RequestMethod.POST,value="/addBean")


问题原因:

问题在于少写了个@RequestBody 注释,虽然没有用@JsonView 对返回JSON进行配置。

此外,错将@RequestMapping 的 value 属性写为了name属性也会提示类似错误!


编辑代码老是弄出好多<span ...> ,吐槽下,好烦










原创粉丝点击