一、问题描述
在IDEA中启动Tomcat,访问项目
localhost:8080/GZ/dtcasehistory/getcasehistory
一直提示错误:
08-29 15:52:34.033 DispatcherServlet with name 'spring' processing POST request for [/GZ/dtcasehistory/getcasehistory]
08-29 15:52:34.050 Looking up handler method for path /GZ/dtcasehistory/getcasehistory
08-29 15:52:34.095 Did not find handler method for [/GZ/dtcasehistory/getcasehistory]
08-29 15:52:34.096 No mapping found for HTTP request with URI [/GZ/dtcasehistory/getcasehistory] in DispatcherServlet with name 'spring'
08-29 15:52:34.096 Successfully completed request
No mapping found for HTTP request with URI [xxxx] in DispatcherServlet 没有该映射
二、解决方法
在spring.xml和web.xml中,查找了几遍,都没有发现有什么错误,然后就想到了是不是IDEA的Tomcat配置有问题,打开Idea的tomcat配置页面:
发现我访问的是localhost:8080/GZ/xxx,而这里配置的并没有GZ,所以错误就在这,选择Deployment,在路径中加入GZ
再回到上一个页面就会发现多了一个GZ