备案/许可证编号:粤ICP备17106855号,工信部网站(http://www.beian.miit.gov.cn)
1234567891011121314151617181920
1.Open IDEA,choose "New-->Project"2.Choose "Spring Initializr"-> next3.Project Metadata:Group: com.chanchifengArtifact: server-systemDescription: server-system project for Spring Boot-> next4. Choose "Web"-> next5.删除.mvn,mvnw,mvnw.cmd。
1234567891011121314151617
HelloController.java:package com.chanchifeng.serversystem;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.context.annotation.ComponentScan;@SpringBootApplication@ComponentScan("com.chanchifeng.serversystem.ctrl")public class ServerSystemApplication { public static void main(String[] args) { SpringApplication.run(ServerSystemApplication.class, args); }}
123456789101112131415161718192021222324
package com.chanchifeng.serversystem.ctrl;import org.springframework.boot.autoconfigure.EnableAutoConfiguration;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;/** * @author:porschan * @description: * @date: Created in 10:14 2018/6/15 * @modified By: */@RestController@EnableAutoConfigurationpublic class HelloController { @RequestMapping("/hello") public String index(){ System.out.println("进入controller"); return "Hello World!"; }}