【spring-mvc 报404错误问题】麻烦大神帮忙看看 :)

目录结构
web.xml

xxx-servlet.xml
java代码
Console

图片说明
各种环境都有,spring下面的包,commons-logging.jar,请问怎么解决?

没有加载到Spring的配置文件吧,web.xml中你注释掉了

没有加载到Spring的配置文件吧,web.xml中你注释掉了

web.xml中没有配置spring-servlet.xml

你处理的是/hello 你的mv的里面直接写hello,不认识

404是找不到,跟你的上面的警告没有关系的,就像ssh一样的,如果你配置的拦截器是/*,那么你的返回的格式也要是/+你的其他的东西;你的问题就是
mv.setviewName("/hello")

你没有配置@controller和requestmapping

可以参考下这里:http://blog.csdn.net/evankaka/article/details/47023975

hey, 你虽然在xml中配置了bean,但是spring的机制只是把他当做bean ,不是controller,你实现了controller的接口! 所以如果你要配置扫描包的路径
及其@Controller.@RequestMapping

发现是web.xml位置放错了,555555, 还有就是viewResovel 那里的prefix应该是 "/jsp" ,默认url是 classpath : locallhost:8080/项目名

类上面加
@Controller
@RequestMapping("/hello")

<context-param>
   <param-name>contextConfigLocation</param-name>
   <param-value>classpath:applicationContext.xml</param-value>
</context-param>
<!-- 对Spring容器进行实例化 -->
<listener>
      <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

图片说明 我这传不了图片。你都没定义配置文件要访问哪个spring-servlet-xml