JavaWeb中常用Maven配置与Xml配置

Xml配置(基于Tomcat 9)

<?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"
         metadata-complete="true">


</web-app>

Jar包依赖:

<dependencies>
        <!--Servlet依赖 -->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>4.0.1</version>
        </dependency>

        <!-- JSP依赖 -->
        <dependency>
            <groupId>javax.servlet.jsp</groupId>
            <artifactId>javax.servlet.jsp-api</artifactId>
            <version>2.3.3</version>
        </dependency>
		<!--JSTL表达式的依赖-->
       <dependency>
      		<groupId>javax.servlet.jsp.jstl</groupId>
      		<artifactId>jstl-api</artifactId>
     		 <version>1.2</version>
    	</dependency>
		<!--standard标签库-->
    	<dependency>
     		 <groupId>taglibs</groupId>
     		 <artifactId>standard</artifactId>
      		<version>1.1.2</version>
    	</dependency>
    	<!--连接数据库-->
    	<dependency>
     		 <groupId>mysql</groupId>
     		 <artifactId>mysql-connector-java</artifactId>
      		<version>5.1.47</version>
    	</dependency>
        <!--单元测试-->
    	<dependency>
     		 <groupId>junit</groupId>
     		 <artifactId>junit</artifactId>
      		<version>4.12</version>
    	</dependency>

 </dependencies>
上一篇:讲讲session是怎么工作的,session的用法?


下一篇:【思特奇杯·云上蓝桥-算法集训营】第1周