hello world

(eclipse) springboot-1 hello world

 (eclipse) springboot-1 hello world

 

(eclipse) springboot-1 hello world

 

(eclipse) springboot-1 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

(eclipse) springboot-1 hello world

 (eclipse) springboot-1 hello world

注意: 不要使用 run as java application 

可能会出现  非预期的情况 

(eclipse) springboot-1 hello world

 

相关文章: