[The first SpringBoot project of the J2EE framework] Writing of Hello_SpringBoot

It is convenient to start the writing of Hello_SpringBoot

Just follow the previous tutorial to configure it, although I haven't written it yet, haha

0x01 Create a new Hello

package com.Sky.o2o;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Hello {
    @RequestMapping(name = "/hello", method = RequestMethod.GET)
    public String hello() {
        return "hello, you fucking guys springBoot";
    }
}

0x02 Comment

Comment the code in the red box below in pom.xml, because it will start using Java Application later

Note 1

0x03 Configure application.properties

This file is the configuration file of the Springboot project, which configures the port number and prefix for the project under this file to run:

server.port=8080
#加入/o2o前缀
server.context-path=/o2o

0x04 Check the previous steps, right click to run in Java Application mode

Note 2

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326687213&siteId=291194637