开发者社区> 问答> 正文

关于maven搭建springmvc环境时测试问题

1.配置没有出现错误,可以正常发布在tomcat服务器上。

2.控制层测试代码


@Controller 
 public class indexController {

     @RequestMapping("hello")
     public String helloworld(){
         return "idnex1";
     }
 } 

3.测试路径http://localhost:8080/demo/hello1.html

页面显示错误 
HTTP Status 404 - 

type Status report 

message 

description The requested resource is not available. 

Apache Tomcat/8.0.33
4.发布到服务器时跟路径也无法得到 http://localhost:8080/demo/

警告:
`
No mapping found for HTTP request with URI [/demo/] in DispatcherServlet with name 'Dispatcher'
`

展开
收起
爵霸 2016-03-23 11:55:43 2209 0
1 条回答
写回答
取消 提交回答
  • @RequestMapping("hello"),那么请求就是“hello”,为什么后面多了一个1,你又没有使用通配符

    2019-07-17 19:10:42
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
移动互联网测试到质量的转变 立即下载
给ITer的技术实战进阶课-阿里CIO学院独家教材(四) 立即下载
F2etest — 多浏览器兼容性测试整体解决方案 立即下载