<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>tq</display-name> <!--log4j配置-->
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>classpath:log4j.properties</param-value>
</context-param>
<!--log4j配置-->
<context-param>
<param-name>log4jRefreshInterval</param-name>
<param-value>6000</param-value>
</context-param>
<!--启动log4j-->
<listener>
<listener-class>
org.springframework.web.util.Log4jConfigListener
</listener-class>
</listener> <!-- Spring MVC配置 -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!-- 可以自定义servlet.xml配置文件的位置和名称,默认为WEB-INF目录下,名称为[<servlet-name>]-servlet.xml,如spring-servlet.xml
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-servlet.xml</param-value>&nbsp; 默认
</init-param>
-->
<load-on-startup>1</load-on-startup>
</servlet> <servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> <!-- Spring配置 -->
<listener>
<listenerclass>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener> <!-- 指定Spring Bean的配置文件所在目录。默认配置在WEB-INF目录下 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:config/applicationContext.xml</param-value>
</context-param> </web-app>

Spring XML配置文件示例(二)——web.xml的更多相关文章

  1. WebApplicationInitializer究 Spring 3.1之无web.xml式 基于代码配置的servlet3.0应用

    本文转自http://hitmit1314.iteye.com/blog/1315816 大家应该都已经知道Spring 3.1对无web.xml式基于代码配置的servlet3.0应用.通过spri ...

  2. Spring MVC 搭建过程中web.xml配置引入文件的路径问题

    为啥要说一下这么low的问题,因为我是一个比较low的人,哈哈.本来我技术有限,没事干自己撘个环境找找乐趣,结果被各种基础问题,弄的一脸蒙蔽.算了不多说,直接说问题. 1.首先说一下java编译后的文 ...

  3. web应用配置文件详解(web.xml)

    转载链接地址:http://blog.csdn.net/guihaijinfen/article/details/8363839 <?xml version="1.0" en ...

  4. Spring之WebContext不使用web.xml启动 初始化重要的类源码分析(Servlet3.0以上的)

    入口: org.springframework.web.SpringServletContainerInitializer implements ServletContainerInitializer ...

  5. 【web.xml】项目从web.xml开始

    前言 依自己目前的所闻所见,每个项目的WEB-INF下都会带有一个web.xml配置文件.当启动项目时,web容器(tomcat)会首先去读取web.xml中的内容,读取加载完成后才算完成了项目的启动 ...

  6. 解决Eclipse里的Maven工程pom.xml文件报:web.xml is missing and <failOnMissingWebXml> is set to true错误

    打开eclipse准备进行开发时,发现项目上有个红星号,查看错误后发现报了一个:"web.xml is missing and <failOnMissingWebXml> is ...

  7. 建立maven工程pom.xml报错:web.xml is missing and <failOnMissingWebXml> is set to true

    解决方式:如图添加web.xml文件即可

  8. 如何在web.xml文件中引入其他的xml文件(拆分web.xml)

    转载自:http://www.blogjava.net/jiangjf/archive/2009/04/09/264685.html 最近在做一个Servlet+javaBean的项目,服务器用的是t ...

  9. Spring 读取配置文件(二)

    Spring 读取配置文件并调用 bean package cn.com.test.receive; import org.springframework.beans.factory.annotati ...

随机推荐

  1. Linux 查找指定名称的进程并显示进程详细信息

    实际应用中可能有这样的场景:给定一个进程名称特征串,查找所有匹配该进程名称的进程的详细信息. 解决的办法是: (1) 先用pgrep [str] 命令进行模糊匹配,找到匹配该特征串的进程ID: (2) ...

  2. ModelState.IsValid

    model内的设置如下所示: /// <summary> /// 取得或设置邮编 /// </summary> [RegularExpression(@"(^[1-9 ...

  3. chrome调试命令模式

    哈哈哈

  4. 【leetcode】Rotate Image

    Rotate Image You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees ...

  5. 79 两个整数集合A和B,求其交集

    [本文链接] http://www.cnblogs.com/hellogiser/p/ab-intersect.html [题目] 两个整数集合A和B,求其交集. [分析]   1. 读取整数集合A中 ...

  6. ansible操作远程服务器报Error: ansible requires the stdlib json or simplejson module, neither was found!

    通过ansible执行远程命令时报如下异常: Error: ansible requires the stdlib json or simplejson module, neither was fou ...

  7. PHP无法编译undefined reference to `libiconv_open

    ./configure --prefix=/usr/local/php52 make时提示:.....................................................e ...

  8. suse linux 10 下配置vpn服务器(pptp)

     一.安装所需的软件包:      pptpd-*.rpm      ppp-*.rpm      pptp-*.rpm     一般情况下系统已经将pptp和ppp包安装好了,所以只需安装pptpd ...

  9. 【leetcode】Minimum Depth of Binary Tree (easy)

    Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shor ...

  10. 【python】入门学习(八)

    异常处理: python在遇到问题时会自动引发异常,也可以用raise故意引发异常,异常种类必须是已有的 >>> raise IOError('This is a test.') T ...