java_Web 实战01

java_Web 实战01

之前我写了一个系统,写的很挫,但是我现在准备再次分析一遍,来实现温故知新。

首先要配置环境包括pom,mybati的xml文件等等.

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>ManagerSystems</artifactId>
  <packaging>war</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>ManagerSystems Maven Webapp</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>javax.servlet.jsp</groupId>
      <artifactId>javax.servlet.jsp-api</artifactId>
      <version>2.3.3</version>
      <scope>provided</scope>
    </dependency>

    <!--    axios-->
    <!-- https://mvnrepository.com/artifact/org.webjars.npm/axios -->
    <dependency>
      <groupId>org.webjars.npm</groupId>
      <artifactId>axios</artifactId>
      <version>1.6.8</version>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>

    </dependency>
    <!--    Maven helper 插件-->
    <!-- https://mvnrepository.com/artifact/org.nuiton/maven-helper-plugin -->
    <!-- https://mvnrepository.com/artifact/org.nuiton/maven-helper-plugin -->
    <!--     serlet api-->
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>4.0.1</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.17.0</version>
    </dependency>
    <!--    mybatis-->
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.5.6</version>
    </dependency>
    <!--    mysql-->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.33</version>
    </dependency>
    <dependency>
      <groupId>jstl</groupId>
      <artifactId>jstl</artifactId>
      <version>1.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.apache.taglibs/taglibs-standard-impl -->
    <dependency>
      <groupId>org.apache.taglibs</groupId>
      <artifactId>taglibs-standard-jstlel</artifactId>
      <version>1.2.5</version>
    </dependency>

  </dependencies>

  <build>
    <finalName>ManagerSystems</finalName>
    <plugins>
      <!--tomcat插件-->
      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <port>7463</port>
          <!--          <path>/web_demo_3/HelloWeb.html</path>-->
          <!--                 web_demo_3/HelloWeb.html-->
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>11</source>
          <target>11</target>
        </configuration>
      </plugin>
    </plugins>

  </build>
</project>

<!DOCTYPE configuration
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
    <environments default="development">
        <environment id="development">
            <transactionManager type="JDBC"/>
            <dataSource type="POOLED">
                <property name="driver" value="com.mysql.jdbc.Driver"/>
                <property name="url" value="jdbc:mysql:///db3?useSSL=false"/>
                <property name="username" value="root"/>
                <property name="password" value="123456"/>
            </dataSource>
        </environment>
    </environments>
    <mappers>
       <mapper resource="com/home/mapper/UserMapper.xml"></mapper>
        <mapper resource="com/home/mapper/ShopperMapper.xml"></mapper>
        <mapper resource="com/home/mapper/HouseMapper.xml"></mapper>
        <mapper resource="com/home/mapper/AgentMapper.xml"></mapper>
    </mappers>
</configuration>


posted @ 2024-12-17 19:33  元始天尊123  阅读(8)  评论(0编辑  收藏  举报