基于SpringMVC的web应用的ContextLoaderListener与DispatcherServlet标准组合配置
来源:互联网 发布:三维全景漫游软件 编辑:程序博客网 时间:2024/06/04 23:22
A standard spring web application create a web.xml with ContextLoaderListener
and DispatcherServlet
.
I understand that the ContextLoaderListener should be used to load the stuff that is not web relevant and the DispatcherServlet is used to load the web relevant stuff (Controllers,...). And this result in two contexts: a parent and a child context.
web.xml文件:
<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-context.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
<servlet> <servlet-name>spring-mvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring-velocity.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring-mvc</servlet-name> <url-pattern>*.jhtml</url-pattern> </servlet-mapping>
spring-context文件:
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="location" value="classpath:dbcp-config.properties" /></bean><import resource="spring-datasource-jdbc.xml" /><import resource="spring-dao.xml" /><import resource="spring-manager.xml" /><import resource="spring-service.xml" />
spring-service文件:
<context:component-scan base-package="com.xhd.lender.web.service"/>
<context:component-scan base-package="com.xhd.lender.web.controller"/>
0 0
- 基于SpringMVC的web应用的ContextLoaderListener与DispatcherServlet标准组合配置
- DispatcherServlet与ContextLoaderListener的对比
- Spring与web MVC的整合——Spring的应用上下文管理 -- DispatcherServlet与ContextLoaderListener解释
- ContextLoaderListener与DispatcherServlet所加载的区别
- Spring ContextLoaderListener 与 SpringMVC DispatcherServlet所加载的applicationContext的区别
- SpringMVC DispatcherServlet 说明与web配置
- SpringMVC DispatcherServlet 说明与web配置
- springmvc 的dispatcherservlet的配置
- 在搭建Spring框架时,web.xml文件的配置之DispatcherServlet&ContextLoaderListener
- 原博文补充: web.xml配置中ContextLoaderListener和DispatcherServlet的区别:
- 关于SpringMVC的DispatcherServlet配置
- web.xml中DispatcherServlet和ContextLoaderListener的区别
- ContextLoaderListener和DispatcherServlet的相互关系
- DispatcherServlet 和 ContextLoaderListener 的关系
- ContextLoaderListener与DispatcherServlet所加载的applicationContext的区别
- Spring ContextLoaderListener与DispatcherServlet所加载的applicationContext的区别
- ContextLoaderListener与DispatcherServlet所加载的applicationContext的区别
- Spring ContextLoaderListener与DispatcherServlet所加载的applicationContext的区别
- hadoop-2.6.0运行woudcount报错
- easyui常用控件及样式收藏
- 理解OAuth 2.0
- 开源C/C++网络库比较 ace &&bosst
- 关于素数(持续更新)
- 基于SpringMVC的web应用的ContextLoaderListener与DispatcherServlet标准组合配置
- hibernate expecting IDENT, found '*' 怎么解决?
- morphia与spring的整合
- Core Animation 基本动画效果汇总
- android开发——从相册中选择图片不裁剪
- 直接插入排序
- 图像处理和图像识别中常用的OpenCV函数
- SQLPLUS常用命令
- LATCH: Learned Arrangements of Three Patch Codes