1.SpringBoot的创建
hello.java
package com.leo.controller;import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;//请求处理类
@RestControllerpublic class hello {@RequestMapping("/hello")public String hello(){System.out.println("hello world ");return "return hello world";}@RequestMapping("/hellos")public String hellos(){System.out.println("hello worlds ");return "return hello worlds";}
}
springboot启动成功
hello的时候就 return hello world
hellos的时候就 return hello worlds
并且在控制台也有相应的输出句子打印出来