zoukankan      html  css  js  c++  java
  • springboot学习

    springboot搭建

    1、idea新建maven项目

    2、pom.xml引入下面代码

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.3.RELEASE</version>
        <relativePath/>
    </parent>
    
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
    </dependencies>
    

    3、新建application.java

    @SpringBootApplication
    public class WebApplication {
        public static void main(String[] args) { SpringApplication.run(WebApplication.class, args); }
    }
    

    4、新建controller

    @Controller
    public class IndexController {
    
        @RequestMapping("/index")
        @ResponseBody
        public String index() {
            return "Hello World!";
        }
    }
    

    5、启动main方法,浏览器打开/index,出现helloword

  • 相关阅读:
    km算法
    HDU 1358
    HDU 3746
    CF 432D
    HDU 4725
    14年百度之星资格赛第四题
    AC自动机
    RMQ
    HDU 4635
    HDU 3667
  • 原文地址:https://www.cnblogs.com/wxbty/p/10939968.html
Copyright © 2011-2022 走看看