免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開APP
userphoto
未登錄

開通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開通VIP
如何配置spring的監(jiān)聽器

1、可以參考struts的docs文檔spring-plugin.html。

2、也可以參考spring的幫助文檔的15.4節(jié)struts。

  • Configure the Spring listener
web.xml
<listener>    <listenerclass>org.springframework.web.context.ContextLoaderListener</listener-class></listener><context-param>
    <param-name>contextConfigLocation</param-name>
<!--<param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value>-->
  <param-value>classpath:beans.xml</param-value>
</context-param>
默認(rèn)的路徑是>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml,也可以把spring的配置文件放到src目錄下,配置就是classpath:beans.xml。其中beans.xml是文件名。
原幫助文檔的描述:
applicationContext.xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"><beans default-autowire="autodetect">    <bean id="personManager" class="com.acme.PersonManager"/>    ...</beans>
More applicationContext configuration filesneeded?
Since the Spring integration uses a standard Listener, it can beconfigured to support configuration files other thanapplicationContext.xml. Adding the following to yourweb.xml will cause Spring's ApplicationContext to be inititalizedfrom all files matching the given pattern:
<!-- Context Configuration locations for Spring XML files -->
<context-param>    <param-name>contextConfigLocation</param-name>    <param-value>/WEB-INF/applicationContext-*.xml,classpath*:applicationContext-*.xml</param-value></context-param>

See the Spring documentation for a full description of thisparameter.

注意:

如果beans.xml文件放在src目錄下,在生成ApplicationContextctx=newClassPathXmlApplicationContext("beans.xml");但若是applicationContext.xml必須放到WEB-INF下的Classes目錄下,才能用ApplicationContextctx=newClassPathXmlApplicationContext("applicationContext.xml");生成ApplicationContext,若是直接放到WEB-INF下會(huì)拋出異常說(shuō)找不到applicationContext文件

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
spring 使用多個(gè)XML配置文件
org.springframework.web.context.ContextLoaderListener .
Struts 2框架整合Spring
ApplicationContext中profile指定解讀
Spring MVC配置文件的三個(gè)常用配置詳解
Spring MVC 入門
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服