• 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>

  • 相关阅读:
    跌到哪儿会反弹
    训练看盘能力的方法
    如何设置ListView控件中的列头的颜色!
    市场正在构筑顶部的几个明显征兆
    Managing Unhandled Exceptions in .NET
    Eclipse 3.3.2中配置Visual Editor
    杨建:网站加速系统架构篇
    杨建:网站加速服务器编写篇
    杨建:网站加速实例分析篇
    涨停技术-教你如何捕捉涨停版best
  • 原文地址:https://www.cnblogs.com/ncepu/p/13695108.html
Copyright © 2020-2023  润新知