<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>springmvc_01</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list> <!--设置编码,这里只是post级别的编码设置, get级别的编码仍然要在server.xml中配置-->
<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>/*</url-pattern>
</filter-mapping> <servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<!--设置spring.xml文件位置 一般默认是在web-inf下,现在设置的是在src下 -->
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc-servlet.xml</param-value>
</init-param>
<!--服务一启动就加载-->
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc</servlet-name>
<url-pattern>*.action</url-pattern>
</servlet-mapping>
</web-app>

或者

<listener>
    <listener-class> org.springframework.web.context.ContextLoaderListener< /listener-class>
</listener>
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml</param-value>
</context-param>

  

最新文章

  1. PHP 操作mongodb api大部分方法
  2. Ubuntu下VSFTPD(六)(常见FTP命令及其功能) (
  3. C C++实现创建目录
  4. 第四章 jQuery中的事件
  5. 定义文字用em、rem,效果和px一样
  6. GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)
  7. stringstream复用【原创】
  8. c++ 11 多线程教学(1)
  9. Sql存储过程解密方法
  10. 趣味Java算法题(附答案)
  11. [Git] 1、常用Git命令行总结(一)
  12. SQL运行时间
  13. while,until
  14. CNN大战验证码
  15. ABP之事件总线(4)
  16. git之win安装git和环境配置及常用命令总结
  17. 什么是K线?K线的详解!
  18. java中GZIPOutputStream 流的使用(EOFException)
  19. 标准的Flask启动文件
  20. Linux_MySql_yum_安装

热门文章

  1. poj - 3041 Asteroids (二分图最大匹配+匈牙利算法)
  2. 技术杂记之:在阿里云centos7上部署JDK MYSQL TOMCAT
  3. 采用jmeter和泛化测试dubbo服务接口
  4. Unix时间戳(Unix timestamp)转换
  5. 使用OpenCV读、操作、写图像并与bash合作对某个文件夹下全部图像进行相似处理
  6. [Erlang危机](5.1.4)端口port
  7. cocos2d-x 求相交矩阵
  8. MongDB应用
  9. jeasyui控件事件和方法的使用方法
  10. [办公自动化]凭证纸打印 IE 默认设置