java ssm框架入门(三)正式项目的web.xml配置
一个正规的上线的web.xml的配置。
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="struts_blank" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> <display-name>myWeb Application</display-name> <filter>
<filter-name>setCharactor</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>setCharactor</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping> <filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter> <filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.action</url-pattern>
</filter-mapping> <context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> <listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener> <session-config>
<session-timeout>30</session-timeout>
</session-config> <welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
1.配置Struts (filter 过滤器)
Struts属于过滤器,过滤器却不只Struts的配置。还可以加入自己需要的专属过滤器
2.配置Spring (listener 监听器)
Spring 属于监听器,监听器却不只Spring 的配置。还可以加入自己需要的专属监听器
3.系统参数的配置,比如session存活时间,默认页面,错误页面
java ssm框架入门(三)正式项目的web.xml配置的更多相关文章
- java ssm框架入门(一)面向接口编程
因为工作上用到spring + strtus2 + mybatis ,所以开始学习下这个框架. 这里用到的是MySQL数据库 首先从web.xml 开始 <?xml version=" ...
- 使用 java替换web项目的web.xml
创建一个接口: package my.web; public interface SpringWeb { void config(); } 实现类: package my; import my.web ...
- maven(四):一个基本maven项目的pom.xml配置
继续之前创建的test项目,一个基本项目的pom.xml文件,通常至少有三个部分 第一部分,项目坐标,信息描述等 <modelVersion>4.0.0</modelVersion& ...
- maven web项目的web.xml报错The markup in the document following the root element must be well-formed.
maven项目里面的web.xml开头约束是这样的 <?xml version="1.0" encoding="UTF-8"?> <web-a ...
- Spring mvc项目的web.xml以及注释
web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app id="WebApp ...
- java ssm框架入门(二)添加语言滤器
使用过滤器是在web.xml中使用filter,以下是码过滤器,过滤所有资源的使用 web.xml <filter> <filter-name>setCharactor< ...
- Maven项目的pom.xml配置文件格式初识
Maven项目 有pom.xml文件的项目就已经是一个maven项目了,但是还没有被maven托管,我们需要将该项目添加为maven项目 <project xmlns="http:// ...
- IDEA创建maven项目的web.xml头
使用IDEA创建maven项目骨架是webapp时,软件自动创建的web.xml文件是2.3版本的,不能使用el表达式,所以可以手动换成4.0的文件头. <?xml version=" ...
- Idea创建Maven Web项目的web.xml版本问题
问题描述:创建Maven Web项目时,选择MavenWebapp模板时,自动生成的web.xml文件版本为1.4,如图所示 如何才能修改为常用的4.0版本的xml文件呢? 这个文件是从Maven仓库 ...
随机推荐
- 二十道经典C#面试题
1.在下面的代码中,如何引用命名空间fabulous中的great? namespace fabulous{// code in fabulous namespace}namespace super{ ...
- java学习笔记1--开发环境平台总结
本文地址:http://www.cnblogs.com/archimedes/p/java-study-note1.html,转载请注明源地址. 1.Java程序设计语言 Java程序设计语言是一种高 ...
- build path libraries java基础--Jar包添加到build path方式说明--01
摘自: http://blog.csdn.net/haolongabc/article/details/7007701 java基础--Jar包添加到build path方式说明--01 前言:这段短 ...
- vb.net中将DataGridView与数据源绑定
在< .net中将DataGridView内的数据导出为Excel表格>中说了如何导出数据到Excel,今天这篇文章将讲述如何绑定数据源,在控件中显示我们需要的信息. 在敲机房收费系统的时 ...
- Transformer中引用iqd作为数据源导入报错TR1907与TR3312
好久没和transform接触了,初次接触就给我送了个大礼,在选择好iqd文件执行最后一步导入的时候,要求我对数据源输入用户名密码,我连续输入了三次用户名和密码,在我十分肯定用户名和密码没错的情况下, ...
- 用php编写我的第一段代码:hello world
一.php环境的搭建 在编写php前,先搭建php环境,我选择了一站式安装软件WampServer,WampServer的下载地址:http://www.wampserver.com/ WampSer ...
- 安装TeX及中文支持
2014.7.19更新: 以下的笔记适用于在基于Ubuntu的发行版(比方LinuxMint)安装Texlive2013.2014: 第一步依据本机状况.可能不须要. Texlive2014已经能够下 ...
- react 调用项目中的 .html 文件
(1)将 html 文件 放于 public 文件夹下 (2)window.open('about:blank').location.href="http://localhost:3000/ ...
- Autodesk FBX SDK Program 中文 (一)
这是我的FBX SDK学习笔记.如文有错误.麻烦各位大大指出 为什么要使用FBX SDK? 由于3D建模软件都被AutoDesk收购了.FBX能够在各个建模软件之间互相导入导出,在非常多游戏引擎中也用 ...
- brew install memcache get Error: Formulae found in multiple taps
本篇文章由:http://xinpure.com/brew-install-memcache-get-error-formulae-found-in-multiple-taps/ 安装环境: Mac ...