<!--web.xml 元素简介-->

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<display-name>Sample Application</display-name>

<!-- 文件清单 -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>

<description>
This is a Page !
</description>

<!--过滤器--->
<filter>
<filter-name>SampleFilter</filter-name>
<filter-class>mypack.SampleFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>SampleFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>

<!-- servlet 配置:<servlet-mapping> 为映射 -->
<servlet>
<servlet-name>SampleServlet</servlet-name>
<servlet-class>com.example.AddServlet.AddEmpServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SampleServlet</servlet-name>
<url-pattern>/add</url-pattern>
</servlet-mapping>

<!-- 错误页引用 -->
<error-page>
<error-code>500</error-code>
<location>/error.htm</location>
</error-page>

<!-- session 保存的秒数:300 s -->
<session-config>
<session-timeout>500</session-timeout>
</session-config>

<!-- web 中所有的标签库 -->
<taglib>
<taglib-uri>/mytaglib</taglib-uri>
<taglib-location>/WEB-INF/mytaglib.tld</taglib-location>
</taglib>

<!-- 配置资源引用:servlet 容器管理某个 JNDI Resource -->
<resource-ref>
<description>DB Connection</descrition>
<res-ref-name>jdbc/sampleDB</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

<!-- 配置安全登录验证页 -->
<login-config>
<auth-method>FORM</auth-method>
<realm-name>Tomcat Server Configuration Form-Based Authentication Area<realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-login-config>/check.jsp</form-login-config>
<form-error-page>/error.jsp</form-error-page>
</form-login-config>
</login-config>

</web-app>

web.xml配置详情 - 简要介绍的更多相关文章

  1. SpringMvc web.xml配置详情

    出处http://blog.csdn.net/u010796790 1.spring 框架解决字符串编码问题:过滤器 CharacterEncodingFilter(filter-name) 2.在w ...

  2. web.xml 配置介绍

    这个不是原创,有点早了,具体从哪里来的已经记不得了.但是东西是实实在在的. 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<c ...

  3. java web.xml配置详解(转)

    源出处:java web.xml配置详解 1.常规配置:每一个站的WEB-INF下都有一个web.xml的设定文件,它提供了我们站台的配置设定. web.xml定义: .站台的名称和说明 .针对环境参 ...

  4. tomcat web.xml配置

    关于Tomcat 中 web.xml 文件的配置问题: 1.下面的配置是合法的     <servlet>        <servlet-name>test</serv ...

  5. springmvc web.xml配置之 -- SpringMVC IOC容器初始化

    SpringMVC IOC容器初始化 首先强调一下SpringMVC IOC容器初始化有些特别,在SpringMVC中除了生成一个全局的spring Ioc容器外,还会为DispatcherServl ...

  6. Maven系列--web.xml 配置详解

    一 .web.xml介绍 启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 紧接着,容 ...

  7. ssm框架中,项目启动过程以及web.xml配置详解

    原文:https://blog.csdn.net/qq_35571554/article/details/82385838 本篇主要在基于SSM的框架,深入讲解web.xml的配置 web.xml   ...

  8. Web.xml配置详解(转)

    Web.xml配置详解 Posted on 2010-09-02 14:09 chinaifne 阅读(295105) 评论(16) 编辑 收藏 1 定义头和根元素 部署描述符文件就像所有XML文件一 ...

  9. java web.xml配置详解

    1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Servl ...

随机推荐

  1. MBR(Master Boot Record)主引导记录分析

    root@ubuntu1404:/home/chen# fdisk -l /dev/sda1 Disk /dev/sda1: MB, bytes heads, sectors/track, cylin ...

  2. NTFS 权限讲解 ACL

    节选自:Securing Windows Server 2003 4.1 Protecting Files with NTFS File Permissions The primary techniq ...

  3. mongo vue的常用操作

    查找在某个范围内的记录: {"_id":{$in: [a,b,c]}}     如果images是个数组,则查询方式与普通数据一样:{"images":&quo ...

  4. 虚拟机设置静态ip

    最近学习hadoop,用到虚拟机来做分布式,由于hadoop要配置slave节点的主机名,所以需要修改hosts文件的ip地址和主机名的映射关系. 但是虚拟机每次重启后,ip地址都会变 ,这样每次都得 ...

  5. Java输入流之BufferReader和Scanner的用法!

    在Java中,我们都知道Java的标准输入串是System.in.但是我们却很少在Java中看到谁使用它,这是因为我们平时输入的都是一个字符串或者是一个数字等等.而System.in提供的read方法 ...

  6. ant build utf-8

    使用Ant编译过程中,报error: unmappable character for encoding UTF8 最简单的方法是在Build.xml文件中,在所有出现Javac的地方,增加一个选项: ...

  7. ConcurrentHashMap Put()操作示例代码

    非常简练: private static void put(MetricKey key, float value) { MetricValue current; do { current = map. ...

  8. [转]倍数提高工作效率的 Android Studio 奇技

    转自:http://android.jobbole.com/81687/ 倍数提高工作效率的 Android Studio 奇技 2015/10/08 · 技术分享 · 4 评论· Android S ...

  9. javascript实现有向无环图中任意两点最短路径的dijistra算法

    有向无环图 一个无环的有向图称做有向无环图(directed acycline praph).简称DAG 图.DAG 图是一类较有向树更一般的特殊有向图, dijistra算法 摘自 http://w ...

  10. 一种在视频OBJECT标签上放置均分四个区域的框选方法

    一般在视频区域中做框样式,作应由视频插件自己来实现,但是出于其它一些原因自己琢磨了一个使用HTML标签来实现框选区域的方法,按照行外应该属于笨方法,虽然有点笨,可能在其他方面有借鉴意义,在这里拿出来跟 ...