zoukankan      html  css  js  c++  java
  • web.xml配置详解

    web.xml配置详解,学J2EE,大部分是走向,做Web项目+大数据。

    而每一个Web项目,必须有一个web.xml文件。

    而分析Web项目,必经之路的起点在web.xml文件。

    web.xml学名叫部署描述符文件,是在Servlet规范中定义的,是web应用的配置文件。

    注意:①大小写敏感。②元素的次序敏感。③所有元素在<web-app>...</web-app>中。

    web.xml示例:来自struts-2.3.20.1srcappslanksrcmainwebappWEB-INF

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_9" 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>Struts Blank</display-name>
    
        <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>/*</url-pattern>
        </filter-mapping>
    
        <welcome-file-list>
            <welcome-file>index.html</welcome-file>
        </welcome-file-list>
    
        <!-- Restricts access to pure JSP files - access available only via Struts action -->
        <security-constraint>
            <display-name>No direct JSP access</display-name>
            <web-resource-collection>
                <web-resource-name>No-JSP</web-resource-name>
                <url-pattern>*.jsp</url-pattern>
            </web-resource-collection>
            <auth-constraint>
                <role-name>no-users</role-name>
            </auth-constraint>
        </security-constraint>
    
        <security-role>
            <description>Don't assign users to this role</description>
            <role-name>no-users</role-name>
        </security-role>
    
    </web-app>
    

    元素顺序列表


    各元素标签详解:

    <icon>

  • 相关阅读:
    my read map subway / metro / map / ditie / gaotie / traffic / jiaotong
    hd printer lexmark / dazifuyin / dayin / fuyin
    软件应用程序的打包和部署
    99款高质量免费(X)HTML/CSS模板
    PetShop4.0的安装、设置、调试与体验(草稿)
    山塞一个PetShop(Task000)——架构
    如何用C#开发的计算器小软件
    DIV+CSS布局参考站点
    影响计算机性能的设置
    ASP.NET知识点:母版页的路径问题
  • 原文地址:https://www.cnblogs.com/ncepu/p/13695108.html
Copyright © 2011-2022 走看看