hello world




创建一个helloworld
|
@Controller
public class HelloWorld {
@RequestMapping("/hello")
public String hello() {
return "helloworld";
}
}
|
运行
|
package com.shj.springboot;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class SpringbootApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootApplication.class, args);
}
}
|
run as spring boot app


注意: 不要使用 run as java application
可能会出现 非预期的情况

相关文章:
-
2021-06-27
-
2022-12-23
-
2021-05-10
-
2021-04-23
-
2021-05-05
-
2021-12-04
-
2021-04-21