<mvc:annotation-driven />与<context:annotation-config/>

<mvc:annotation-driven/>

  在spring的spring-mvc.xml配置文件中配置,用于启动注解驱动的Spring MVC功能,注册请求url和注解POJO类方法的映射,即作用域@RequestMapping,不配置的话请求的url和controller中的方法没有进行映射,会出现找不到相应的请求路径问题:

WARNING: No mapping found for HTTP request with URI [/springhibernate/employee/list] in DispatcherServlet with name 'spring'

 

<context:annotation-config/>

  这个经常在spring容器中使用,用于开启注解,不过在有<context:compont-scan/>在时可以不要

posted @ 2016-10-14 09:58  冰封绝恋  阅读(140)  评论(0编辑  收藏  举报