tomcat版本和servlet 的版本,jsp的版本和el的版本的关系图以及maven 依赖

Servlet , JSP 规范版本和tomcat 版本之前的关系图

Servlet Spec JSP Spec JSTL(jsp标准标签库) EL Spec WebSocket Spec jdk Apache Tomcat Version JavaEE Version
4.0 2.3 1.2 3.0 1.1 JDK8+ tomcat9.x+以上的配置 Java EE 8
3.1 2.3 1.2 3.0 1.1 JDK7+ tomcat8.x+以上的配置 Java EE 7
3.0 2.2 1.2 2.2 1.1 JDK6+(使用websocket需要JDK7+) tomcat7.x Java EE 6
2.5 2.1 1.2 2.1 jdk5+ tomcat6 Java EE 5

tomcat7.x servlet 3.0 JSP 2.2, EL 2.2 maven 依赖

依赖

 
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>javax.servlet-apiartifactId>
            <version>3.0.1version>
            <scope>providedscope>
        dependency>
        <dependency>
            <groupId>javax.servlet.jspgroupId>
            <artifactId>jsp-apiartifactId>
            <version>2.2version>
            <scope>providedscope>
        dependency>
        <dependency>
            <groupId>javax.elgroupId>
            <artifactId>el-apiartifactId>
            <version>2.2version>
            <scope>providedscope>
        dependency>
        
       
        
        
        <dependency>
            <groupId>javax.servletgroupId>
            <artifactId>jstlartifactId>
            <version>1.2version>
        dependency>
        
        <dependency>
            <groupId>taglibsgroupId>
            <artifactId>standardartifactId>
            <version>1.1.2version>
        dependency>
        

对应的web.xml文件



<web-app
        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_3_0.xsd"
        version="3.0">
  <display-name>Archetype Created Web Applicationdisplay-name>
web-app>

测试

通过插件启动tomcat。

通过将war包赋值到webapps目录下手动启动 都是可以启动的

tomcat 8.x 版本 servlet 3.1 JSP 2.3, EL 3.0 maven 依赖(待测试)

依赖

<dependency>
    <groupId>javax.servletgroupId>
    <artifactId>javax.servlet-apiartifactId>
    <version>3.1.0version>
    <scope>providedscope>
dependency>
<dependency>
    <groupId>javax.servlet.jspgroupId>
    <artifactId>javax.servlet.jsp-apiartifactId>
    <version>2.3.0version>
    <scope>providedscope>
dependency>
<dependency>
    <groupId>javax.elgroupId>
    <artifactId>javax.el-apiartifactId>
    <version>3.0.0version>
    <scope>providedscope>
dependency>
<dependency>
    <groupId>javax.servletgroupId>
    <artifactId>jstlartifactId>
    <version>1.2version>
dependency>

对应的web.xml文件支持


<web-app 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_3_1.xsd"
         version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee">

参考:

Apache Tomcat Versions

Web Application Specifications

Java Platform, Enterprise Edition

The Story of JEE modules

Maven dependency for Servlet 3.0 API?

你可能感兴趣的:(Tomcat)