STS中web.xml配置文件

 1 <!DOCTYPE web-app PUBLIC
 2  "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
 3  "http://java.sun.com/dtd/web-app_2_3.dtd" >
 4 
 5 <web-app>
 6   <context-param>
 7       <param-name>contextConfigLocation</param-name>
 8       <param-value>classpath:applicationContext.xml</param-value>
 9   </context-param>
10   <!-- 设置字符编码,将所有的字符编码同意设置为utf-8 -->
11     <filter>
12         <filter-name>filterEncoding</filter-name>
13         <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
14         <init-param>
15             <param-name>encoding</param-name>
16             <param-value>UTF-8</param-value>
17         </init-param>
18         <init-param>
19             <param-name>forceEncoding</param-name>
20             <param-value>true</param-value>
21         </init-param>
22     </filter>
23     <filter-mapping>
24         <filter-name>filterEncoding</filter-name>
25         <url-pattern>/*</url-pattern>
26     </filter-mapping>
27   <listener>
28   <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
29   </listener>
30   <!-- 配置requestcontext监听器 -->
31   <listener>
32       <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
33   </listener>
34   <servlet>
35       <servlet-name>springmvc</servlet-name>
36       <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
37       <init-param>
38           <param-name>contextConfigLocation</param-name>
39           <param-value>classpath:springmvc.xml</param-value>
40       </init-param>
41   </servlet>
42   <servlet-mapping>
43       <servlet-name>springmvc</servlet-name>
44       <url-pattern>*.do</url-pattern>
45   </servlet-mapping>
46 </web-app>

 

转载于:https://www.cnblogs.com/Fisherman13/p/10708812.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值