zoukankan      html  css  js  c++  java
  • intellij 创建java web项目(maven管理的SSH)

    intellij 创建java web项目(maven管理的SSH)

    环境intellij IDEA14、MAVEN、Spring、Struts2、Hibernate、Java Web。工程搭建。

    1、创建maven项目

    1、关闭现有项目,或者new progect
    第一步关闭现有项目,或者new progect
    2、创建maven的web工程
    这里写图片描述
    3
    这里写图片描述
    4
    这里写图片描述
    5
    这里写图片描述

    2、添加web工程

    6、添加web
    这里写图片描述
    7这里写图片描述

    3、配置tomcat

    8这里写图片描述
    9这里写图片描述
    10这里写图片描述
    11这里写图片描述
    12这里写图片描述

    3、测试

    13这里写图片描述

    贡献出自己的pom.xml文件,仅供参考

    pom.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>mavenSSH</groupId>
        <artifactId>mavenSSH</artifactId>
        <version>1.0-SNAPSHOT</version>
        <dependencies>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.12</version>
            </dependency>
            <dependency>
                <groupId>commons-dbcp</groupId>
                <artifactId>commons-dbcp</artifactId>
                <version>1.2.2</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-webmvc</artifactId>
                <version>3.2.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-web</artifactId>
                <version>3.2.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>c3p0</groupId>
                <artifactId>c3p0</artifactId>
                <version>0.9.1.2</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <!--
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.6.1</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
             -->
            <dependency>
                <groupId>log4j</groupId>
                <artifactId>log4j</artifactId>
                <version>1.2.16</version>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-log4j12</artifactId>
                <version>1.6.1</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-orm</artifactId>
                <version>3.2.2.RELEASE</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-aspects</artifactId>
                <version>3.2.2.RELEASE</version>
            </dependency>
    
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-spring-plugin</artifactId>
                <version>2.3.1.2</version>
            </dependency>
    
    
            <dependency>
                <groupId>org.apache.struts</groupId>
                <artifactId>struts2-json-plugin</artifactId>
                <version>2.3.1.2</version>
            </dependency>
    
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>3.6.10.Final</version>
            </dependency>
            <dependency>
                <groupId>javassist</groupId>
                <artifactId>javassist</artifactId>
                <version>3.12.1.GA</version>
            </dependency>
            <dependency>
                <groupId>mysql</groupId>
                <artifactId>mysql-connector-java</artifactId>
                <version>5.1.6</version>
            </dependency>
            <dependency>
                <groupId>org.apache.tomcat</groupId>
                <artifactId>servlet-api</artifactId>
                <version>6.0.33</version>
                <type>jar</type>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-mapper-asl</artifactId>
                <version>1.9.3</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.codehaus.jackson</groupId>
                <artifactId>jackson-core-asl</artifactId>
                <version>1.9.3</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>commons-lang</groupId>
                <artifactId>commons-lang</artifactId>
                <version>2.6</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.velocity</groupId>
                <artifactId>velocity</artifactId>
                <version>1.7</version>
            </dependency>
            <dependency>
                <groupId>javax.servlet</groupId>
                <artifactId>jstl</artifactId>
                <version>1.2</version>
                <type>jar</type>
                <scope>compile</scope>
            </dependency>
            <dependency>
                <groupId>commons-beanutils</groupId>
                <artifactId>commons-beanutils</artifactId>
                <version>1.8.3</version>
            </dependency>
        </dependencies>
    
    </project>
  • 相关阅读:
    CF 441E Valera and Number
    CodeForces 1111E. Tree
    CodeForces 1098F. Ж-function
    CodeForces 1098E. Fedya the Potter
    CodeForces 1098D. Eels
    CodeForces 1103E. Radix sum
    CodeForces 1103D. Professional layer
    CodeForces 1103C. Johnny Solving
    CodeForces 1107F. Vasya and Endless Credits
    Hackerrank: Week of Code 36
  • 原文地址:https://www.cnblogs.com/lanzhi/p/6467944.html
Copyright © 2011-2022 走看看