跟老师的一样,找不到DispatcherServlet,一直报404,为什么?
我用的tomcat,服务器一启动就会报:
严重: Servlet [mvc-dispatcher] in web application [/spring-mvc-study] threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1091)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1027)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5038)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5348)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1407)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1397)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
九月 25, 2016 12:45:33 下午 org.apache.coyote.AbstractProtocol start
为什么找不到DispatcherServlet啊??
我web.xml文件如下:
Archetype Created Web Application
mvc-dispatcher
org.springframework.web.servlet.DispatcherServlet
contextConfigLocation
/WEB-INF/configs/spring/mvc-dispatcher-servlet.xml
1
mvc-dispatcher
/
我mvc-dispatcher-servlet.xml内容如下:
访问http://localhost:8080/spring-mvc-study这个正常显示
访问http://localhost:8080/spring-mvc-study/hello/mvc 就报404错误
项目目录:
我真的不认为哪里还有问题了,求大神指点 |
免责声明:本内容仅代表回答会员见解不代表天盟观点,请谨慎对待。
版权声明:作者保留权利,不代表天盟立场。
|
|
|
|