SpringBoot的第一个demo,hello

首先使用idea工具创建第一个demo入门程序-----hello,步骤如下操作:

 

 

 

 接着,编写controller类

 

 代码如下:

package com.neo.controlller;

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

@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "Hello Spring Boot 2.0!";
}
}

 启动类运行访问:http://127.0.0.1:8080/

 基本就这样,完成!

猜你喜欢

转载自www.cnblogs.com/studygithub5208868/p/11622500.html
今日推荐