package com.guoguo.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class Index {
@GetMapping(value="/index") //get请求
@ResponseBody //返回json数据
public String index(){
return "我是首页";
}
}
Spring @Controller注解
最新推荐文章于 2024-04-30 14:13:53 发布