想实现spring返回一个json串,结果总是显示404

浏览器地址输入http://localhost:8080/spring-test/doGetUser.do。
错误是:HTTP Status 404 - /spring-test/WEB-INF/{"id":1,"name":"Li","age":45,"salary":3000.0,"hiredate":1509033600000}.jsp

type Status report

message /spring-test/WEB-INF/{"id":1,"name":"Li","age":45,"salary":3000.0,"hiredate":1509033600000}.jsp

description The requested resource is not available.

Apache Tomcat/7.0.67:。怎么解决?

兄弟!是不是没有@responsebody 这个注解

我配置了视图解析器的。如下:


404错误, 路径写错了吗?

贴代码看看,

也可以参考:

https://www.cnblogs.com/ssslinppp/p/4528892.html

/spring-test/WEB-INF/{"id":1,"name":"Li","age":45,"salary":3000.0,"hiredate":1509033600000}.jsp
里面的 {"id":1,"name":"Li","age":45,"salary":3000.0,"hiredate":1509033600000}json字符串没有按照字符串返回,
也就是controller方法上没有加@responsebody 注解。
没有话,会按照jsp页面返回