Spring, Log4j, 等各项在web.xml中配置
2013-09-24 18:49
260 查看
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="WebApp_1227143028044" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <!-- 加载Spring服务 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:/spring-dataSource.xml, classpath:/spring-data.xml, classpath:/spring-server.xml, /WEB-INF/applicationContext-*.xml </param-value> </context-param> <!-- 加载log4j --> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>classpath:/log4j.properties</param-value> </context-param> <context-param> <param-name>webAppRootKey</param-name> <param-value>netctoss.root</param-value> </context-param> <!--处理请求编码格式--> <filter> <filter-name>encodingFilter</filter-name> <filter-class> org.springframework.web.filter.CharacterEncodingFilter </filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>*.do</url-pattern> </filter-mapping> <!-- 自定义过滤器测试 --> <filter> <filter-name>adminFilter</filter-name> <filter-class>com.ghrt.common.AdminFilter</filter-class> </filter> <filter-mapping> <filter-name>adminFilter</filter-name> <url-pattern>/admin/*</url-pattern> </filter-mapping> <!-- 监听Log4j --> <listener> <listener-class> org.springframework.web.util.Log4jConfigListener </listener-class> </listener> <!-- 监听Spring文件 --> <servlet> <servlet-name>SpringContextServlet</servlet-name> <servlet-class> org.springframework.web.context.ContextLoaderServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!--或 --> <!-- <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> --> <!-- 配置dwr --> <servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class> org.directwebremoting.servlet.DwrServlet </servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet> <servlet-name>action</servlet-name> <servlet-class> org.apache.struts.action.ActionServlet </servlet-class> <init-param> <param-name>config</param-name> <param-value>/WEB-INF/struts-config.xml</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>3</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>3</param-value> </init-param> <load-on-startup>0</load-on-startup> </servlet> <servlet> <description> This is the description of my J2EE component </description> <display-name> This is the display name of my J2EE component </display-name> <servlet-name>Image</servlet-name> <servlet-class>com.ghrt.common.Image</servlet-class> </servlet> <!-- eWebEditor 配置 --> <display-name>defaultroot</display-name> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Image</servlet-name> <url-pattern>/servlet/Image</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> <!-- 加载核心标签库 --> <jsp-config> <taglib> <taglib-uri> http://www.java.sun.com/jsp/jstl/core </taglib-uri> <taglib-location>/WEB-INF/jstl/c.tld</taglib-location> </taglib> </jsp-config> <welcome-file-list> <welcome-file>login.jsp</welcome-file> </welcome-file-list> <error-page> <error-code>404</error-code> <location>/404.jsp</location> </error-page> <error-page> <error-code>503</error-code> <location>/500.jsp</location> </error-page> <error-page> <error-code>500</error-code> <location>/500.jsp</location> </error-page> </web-app>
相关文章推荐
- Web.xml Webapp配置加载log4j和Spring
- Web.xml Webapp配置加载log4j和Spring
- web.xml 记载spring 配置文件的写法
- spring-mvc注解web.xml配置问题
- Spring在web.xml中的配置
- spring在web.xml中和在struts中的不同配置
- web.xml中配置Spring容器随项目启动
- JavaEE 下面使用Spring 时 web.xml 中ContextLoaderListener的作用及配置,多个配置文件时contextConfigLocation的作用
- Spring中,applicationContext.xml 配置文件在web.xml中的配置详解
- 怎么在web.xml配置spring,struts2配置以及过滤器
- web.xml集成Spring,Struts配置文件说明
- log4j slf4j 以及web.xml日志配置
- spring web.xml配置服务启动后执行文件
- 转载:spring ,struct2 在 web.xml中的配置
- 搭建spring框架的时候,web.xml中的spring相关配置,可以不用配置ContextLoaderListener(即只配DispatcherServlet)吗?
- web.xml 文件中一般包括 servlet, spring, filter, listenr的配置。那么他们是按照一个什么顺序加载呢?
- spring web.xml配置
- spring在web.xml中的配置
- Spring的web.xml配置
- Spring配置web.xml文件时遇到的问题