JavaWeb中常用Maven配置与Xml配置

2022/1/18 22:03:49

本文主要是介绍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>


这篇关于JavaWeb中常用Maven配置与Xml配置的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程