zoukankan      html  css  js  c++  java
  • idea创建SpringBoot项目

    1. 打开idea,点击创建新项目,选择Spring Initializr

    2. 点击next,填写Group和Artifact

    3. 选择Web,再选择Web复选框

    4. 填写Project name,点击finish

    5. 打开项目目录,删除以下文件夹和文件

    6. 该类是自动生成的,是程序的入口

    package com.example.demo;
    
    import org.springframework.boot.SpringApplication;
    import org.springframework.boot.autoconfigure.SpringBootApplication;
    
    @SpringBootApplication
    public class DemoApplication {
    	public static void main(String[] args) {
    		SpringApplication.run(DemoApplication.class, args);
    	}
    }
    
    

    7. 创建HelloSpringboot

    package com.example.demo;
    
    import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    @RestController
    @EnableAutoConfiguration
    public class HelloSpringboot {
    
        @RequestMapping("/hello")
        public String say() {
            System.out.println("Hello springboot");
            return "hello,this is a springboot demo";
        }
    }
    

    8. 启动DemoApplication

    9. 在地址栏中输入http://localhost:8080/hello

  • 相关阅读:
    关于Android的布局
    一个新的开端
    Flux的基础概念和实战入门
    在Redux中使用插件createAction之后
    学习
    Object.assign() 对象的扩展
    Redux 中的CombineReducer的函数详解
    React组件的防呆机制(propTypes)
    css的新特性 calc () 使用
    shim和polyfill有什么区别
  • 原文地址:https://www.cnblogs.com/yanfei1819/p/7798499.html
Copyright © 2011-2022 走看看