深度解读web.xml

107 篇文章 5 订阅

对于那些乐于探索的小伙伴来说,不会仅仅止步于怎么配置web.xml文件,他们更会关注背后的秘密,今天我将

写下我的探索之路生气

<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_3_0.xsd" metadata-complete="true" version="3.0">
  <display-name>xx平台</display-name>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
	classpath*:applicationContext.xml,xx.xml
    </param-value>
  </context-param>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <welcome-file-list>
    <welcome-file>/WEB-INF/views/index.jsp</welcome-file>
  </welcome-file-list>
</web-app>
相信web开发人员一定对上面的配置很熟悉,这是我节选自web.xml中的一小段配置,下面我将为大家讲述这段配置

背后的秘密,先看一张图:

complexType  "javaee:web-appType"
Namespace:
Content:
complex, 3 attributes, 31 elements
Defined:
globally in web-app_2_5.xsd, see XML source
Includes:
definitions of 3 attributes and 17 elements
Used:
at 1 location
Content Elements (31):
All Direct / Indirect Based Elements (1):

通过上面的数据,相信大家应该明白web.xml可以按照文章开头配置的原因了吧。


如果还想了解context-param、error-page等一些配置的由来,可以点开具体的项:

比如javaee:error-page

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值