环境:
IDE:idea 2017.02
server:Tomcat 9.0.6
框架:ssm + redis
错误现象:
ssm框架下,request的映射路径没有问题,控制台也没有抛出异常,主页能正常打开,但是不能跳转到Controller的路径,
报了以下错误:
The page you tried to access (/manager/text/sessions) does not exist.
The Manager application has been re-structured for Tomcat 7 onwards and some of URLs have changed. All URLs used to access the Manager application should now start with one of the following options:
/manager/html for the HTML GUI
/manager/text for the text interface
/manager/jmxproxy for the JMX proxy
/manager/status for the status pages
Note that the URL for the text interface has changed from "/manager" to "/manager/text".
You probably need to adjust the URL you are using to access the Manager application. However, there is always a chance you have found a bug in the Manager application. If you are sure you have found a bug, and that the bug has not already been reported, please report it to the Apache Tomcat team.
Tomcat找不到页面,Manager Application在Tomcat7中做了更新,所有访问Manager Application的URL必须以下列之一开头,访问的URL不正确,导致找不到页面。
原因猜测:
网上查了一下,只找到一个帖子:https://stackoverflow.com/questions/36462764/accessing-tomcat-manager-throws-404
他给了解决方法,在Tomcat路径下找到配置文件,context.xml,增加一句:
<!-- The contents of this file will be loaded for each web application -->
<Context privileged="true">
<!-- Default set of monitored resources. If one of these changes, the -->
<!-- web application will be reloaded.
加上一句<Context privileged="true">,说是Tomcat权限问题,没仔细研究过,直接改了配置文件,但是没有用。
我的解决方法和一点猜想:
看日志的信息表达的意思可能是因为/manager....是访问Tomcat内部的配置的路径?我看到之前那个人的访问路径也有/manager..,比如http://localhost:8080/manager/html....是访问Tomcat的某个管理项的,其他类似,相当于manager在路径里是不能用的。
于是我改了Controller类里映射路径,把@RequestMapping("/manager")里的"/manager"换成其他字符串,
然后重新启动Tomcat就能正常访问了。