• SpringBoot_Eclipese创建简单的springboot


    1. 创建简单的maven , 点击next

    2. 再次点击next

    3. 依次点击

    4. 依次输入点击finish

    5. pom.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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>com.conn</groupId>
        <artifactId>springboot_agent</artifactId>
        <version>0.0.1-SNAPSHOT</version>
        <packaging>jar</packaging>
    
        <name>springboot_agent</name>
        <url>http://maven.apache.org</url>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        
        <!-- 引入SpringBoot父POM文件 -->
        <parent>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-parent</artifactId>
            <version>1.5.9.RELEASE</version>    
        </parent>
    
        <dependencies>
            <!-- 引入SpringBoot的starter-web依赖 -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-web</artifactId>
            </dependency>
        
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>3.8.1</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </project>

    6.编写主启动类DemoMain

    /**
     * SprintBoot入门案例
     * http://localhost:8080/first/test01.action
     */
    @SpringBootApplication     //添加主启动类注解
    public class DemoMain {    //主启动类
        public static void main(String[] args) {
            SpringApplication.run(DemoMain.class, args);  //启动主类
        }
    }

     7.编写控制类

    8. 编写server

    9. 在主启动类中启动即可.   默认8080端口访问即可

    没用的分割线------------------------------------------------------------------------------------------------------------------------------------

  • 相关阅读:
    BFS(广搜训练题目)
    练习赛1(补题)
    练习赛1(AC题)
    codeup 1743: 算法3-4:表达式求值
    数学相关(更新ing)
    c语言常用函数(更新ing)
    大牛的博客(学习不止,更新不止)
    51nod 1005 大数加法
    js1-----预览js内容
    css10---转载---定位,浮动
  • 原文地址:https://www.cnblogs.com/xia-yi/p/11754064.html
Copyright © 2020-2023  润新知