JAVA WEB程序运行错误:HTTP-404错误

2025-03-24 04:13:32
推荐回答(5个)
回答1:

org.springframework.web.servlet.DispatcherServlet这个类找不到,你把spring的jar都导入到你的工程的lib目录了吗?是tomcat下的目录

回答2:

我来给你解答吧,一般我们经常见到的错误是500 , 404 505 ,500一般大多是网页上面的元素错误,比如说JSP里的脚本代码错误<%%>,404也就是你的web.xml里面搞错了,好好检查一下,或者重新敲下代码.,

回答3:

先要在工程里倒入spring相关包。
然后要在web.xml中配置spring(通过一个servlet把spring导入):

contextConfigLocation

/WEB-INF/configs/applicationContext.xml




org.springframework.web.context.ContextLoaderListener




spring

自定义的SpringLoaderServlet

1

回答4:

先解决java.lang.ClassNotFound:org.springframework.web.servlet.DispatcherServlet吧,好像是Spring.jar没导入好吧.

回答5:

404是地址错误.你检查下是不是路径有问题.