zoukankan      html  css  js  c++  java
  • 在WEB-INF目录下的web.xml文件

    <?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_2_5.xsd"
    	version="2.5">
    	<display-name>ssm</display-name>
    
    	<!-- 实例化ApplicationContext容器 -->
    	<context-param>
    		<!-- 加载src目录下的applicationContext.xml文件 -->
    		<param-name>contextConfigLocation</param-name>
    		<param-value>
      classpath:applicationContext.xml
      </param-value>
    	</context-param>
    
    	<!-- 指定以ContextLoaderListener方式启动Spring容器 -->
    	<listener>
    		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    	</listener>
    
    	<!-- 启动SpringMVC框架 -->
    	<servlet>
    		<servlet-name>springmvc</servlet-name>
    		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    		<init-param>
    			<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>/</url-pattern>
    	</servlet-mapping>
    
    	<!-- 避免中文乱码 -->
    	<filter>
    		<filter-name>characterEncodingFilter</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>
    		<init-param>
    			<param-name>forceEncoding</param-name>
    			<param-value>true</param-value>
    		</init-param>
    	</filter>
    	<filter-mapping>
    		<filter-name>characterEncodingFilter</filter-name>
    		<url-pattern>/*</url-pattern>
    	</filter-mapping>
    
    </web-app>
    
  • 相关阅读:
    未知高度、宽度,垂直水平居中
    js千分位处理
    浮动与两侧皆自适应布局
    html5 canvas 学习笔记(一)
    全面理解javascript的caller,callee,call,apply概念[转载]
    cocos2dx android运行Luac编译后的lua代码
    cocos2dx android lua文件设置问题
    cocos2dx android resources.ap_ does not exist
    Gink掉过的坑(一):将CCTableView导入到lua中
    数据结构之内部排序个人总结
  • 原文地址:https://www.cnblogs.com/LinQingYang/p/11875662.html
Copyright © 2011-2022 走看看