您的位置:首页 > 编程语言 > Java开发

Spring 中配置申明式的配置信息

2016-02-29 00:00 411 查看
摘要: spring annotation

1、 在Web.xml 中指定代码

<!-- Spring root -->
<context-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>org.baeldung.spring</param-value>  <!-- 指定要有@Configuration申明的类路径 -->
</context-param>

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>  <!-- 还是跟以前一样 -->


2、
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  spring annotation