https://docs.spring.io/spring-framework/docs/4.3.9.RELEASE/spring-framework-reference/htmlsingle/#beans-custom-autowire-configurer

<web-app>
<!-- Configure ContextLoaderListener to use AnnotationConfigWebApplicationContext
instead of the default XmlWebApplicationContext -->
<context-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</context-param> <!-- Configuration locations must consist of one or more comma- or space-delimited
fully-qualified @Configuration classes. Fully-qualified packages may also be
specified for component-scanning -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.acme.AppConfig</param-value>
</context-param> <!-- Bootstrap the root application context as usual using ContextLoaderListener -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <!-- Declare a Spring MVC DispatcherServlet as usual -->
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- Configure DispatcherServlet to use AnnotationConfigWebApplicationContext
instead of the default XmlWebApplicationContext -->
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<!-- Again, config locations must consist of one or more comma- or space-delimited
and fully-qualified @Configuration classes -->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>com.acme.web.MvcConfig</param-value>
</init-param>
</servlet> <!-- map all requests for /app/* to the dispatcher servlet -->
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
</web-app>

最新文章

  1. SOAPUI使用教程-MockOperations和响应
  2. 转载:javascript 拖拽排序,简洁示例备忘
  3. reverse string | leetcode
  4. 雅虎工程师初始化css
  5. IOS 取值控件(UIPicker)的使用方法
  6. 字符串模式匹配KMP算法
  7. junit4X系列源码--总体介绍
  8. Carries SCU - 4437
  9. [MySQL]InnoDB引擎的行锁和表锁
  10. 谈谈 iOS 中图片的解压缩
  11. Python connect mariadb(Python连接mysql)
  12. 使用vue+koa实现一个简单的图书小程序(1)
  13. scala 模式匹配详解 3 模式匹配的核心功能是解构
  14. 简单测试--C#实现中文汉字转拼音首字母
  15. 在 OSX 下使用 supervisor 管理服务
  16. ps -ef | grep 查看进程命令
  17. Try Before Choosing
  18. python开发_tkinter_获取文本框内容_给文本框添加键盘输入事件
  19. Android ScrollView 子控件不占满的问题
  20. Day20-单表中获取表单数据的3种方式

热门文章

  1. python中pycharm中.py文件调用一个.py文件的函数
  2. ubuntu终端代理之proxychains
  3. winCE 获取路径信息
  4. MIT 6.824学习笔记3 Go语言并发解析
  5. javascript中无法将string转化为json对象
  6. JavaScript基础1——在末尾添加节点
  7. vue函数防抖和节流
  8. 封装和private,this,super关键字的简单应用
  9. [资料] 常见的IC芯片解密方法与原理解析!
  10. Codeforces Round #340 (Div. 2) E. XOR and Favorite Number (莫队)