Discuss / Java / web.xml 头信息的疑问

web.xml 头信息的疑问

Topic source

既然要引入 servlet 4.0 版本,是否应该按规范按如下引入?

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
                 http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
    version="4.0">
  <display-name>Archetype Created Web Application</display-name>
</web-app>

廖雪峰

#2 Created at ... [Delete] [Delete and Lock User]

实际上只需要保证servlet jar的版本,web.xml没那么严格,到后面有了springboot这个web.xml都不需要了


  • 1

Reply