創(chuàng)建單獨(dú)的Java文件,MAVEN默認(rèn)會(huì)編輯src/main/java下的源碼。例如創(chuàng)建文件src/main/java/Example.java:
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@RestController
@EnableAutoConfiguration
public class Example {
public static void main(String[] args) throws Exception {
SpringApplication.run(Example.class, args);
解讀@RestController和@RequestMapping注解
@RestController構(gòu)造型注解
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。