第一个springboot
package com.study.maven.java_web.hello;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
//请求处理类
@RestController
public class Hello {
@RequestMapping("/hell")//浏览器请求地址调用方法
public String hello() {
System.out.println("Hello, world");//去掉也不影响,貌似可有可无
return "Hello,world!";
}
}
由于8080端口号被占用,在properties中改写端口号:
server.port=8081

浙公网安备 33010602011771号