美文网首页
Springboot的第一个起步练习

Springboot的第一个起步练习

作者: Monica_b73c | 来源:发表于2019-03-18 21:02 被阅读0次

模块内代码

1.HelloController

package com.springboot.quickstart.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {
@RequestMapping(value ="/hello" ,method = RequestMethod.GET)
public String getHello(){
return "Hello,Spring boot";
}

}

2.QuickstartApplication

package com.springboot.quickstart;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
//启动主类
@SpringBootApplication
public class QuickstartApplication {

public static void main(String[] args) {
    SpringApplication.run ( QuickstartApplication.class, args );
}

}

相关文章

网友评论

      本文标题:Springboot的第一个起步练习

      本文链接:https://www.haomeiwen.com/subject/rzhimqtx.html