spring在web.xml中的配置
来源:互联网 发布:aes加密算法c语言实现 编辑:程序博客网 时间:2024/04/29 19:49
<!-- 配置过滤器 需要导入spring的相关jar包-->
<filter>
<filter-name>setCharacterEncoding</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter.class
</filter-class>
<!-- 该参数用于指定字符编码集 -->
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<!-- 该参数用于防止乱码 -->
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<!-- 过滤映射,说明哪些文件需要过滤,此处指对所有文件进行过滤 -->
<filter-mapping>
<filter-name>setCharacterEncoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- 加载多个spring配置文件 -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml,/WEB-INF/action-servlet.xml
</param-value>
</context-param>
<!-- 定义spring监听器,加载spring -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 注册spring的request作用域
request表示该针对每一次HTTP请求都会产生一个新的bean,同时该bean仅在当前HTTP request内有效,配置实例:
request、session、global session使用的时候首先要在初始化web的web.xml(WebRoot文件下的Web.xml文件)
中做如下配置:如果你使用的是Servlet 2.4及以上的web容器
,那么你仅需要在web应用的XML声明文件web.xml(tomcat中的web.xml)中增加下述ContextListener即可-->
<listener>
<listener-class>
org.springframework.web.context.request.RequestContextListener
</listener-class>
</listener>
- spring在web.xml中的配置
- Spring在Web.xml中的配置
- Spring在web.xml中的配置
- spring上下文在web.xml中的配置
- spring在web.xml中的配置
- spring上下文在web.xml中的配置
- spring在web.xml中的配置
- spring在web.xml中的配置
- spring 在web.xml中的配置
- spring在web.xml中的配置
- spring在web.xml中的配置示例
- spring在web.xml中的配置
- spring的applicationContext.xml在web.xml中的配置详解
- spring在web.xml中和在struts中的不同配置
- spring在web.xml中和在struts中的不同配置
- spring在web.xml中和在struts中的不同配置
- spring在web.xml中和在struts中的不同配置
- spring在web.xml中和在struts中的不同配置
- 死神来了2台词 FINAL DESTINATION 2
- 将WORD内容保存为BMP
- <s:if>用法
- 一个程序员的思考
- Linux内存管理总结-地址映射
- spring在web.xml中的配置
- Fedora17 为terminal建立快捷键
- 刘黎明:PaaS是非主流业务,要与IaaS融合
- 创建DB
- svn在vs2010G更新错误解决:web.csproj:error:无法读取项目文件"web.csproj"
- 楚汉传奇中的典故
- 三个故事——说穿很多人
- UVa 10023 - Square root
- 透过源码领悟GCC到底在干些什么(收集整理)