首页>代码>spring boot+mybatis+mysql项目搭建入门实例>/springbootdemo/src/main/java/cn/wmyskxz/springboot/HelloController.java
package cn.wmyskxz.springboot;

/**
 * Created by Administrator on 2018/7/6.
 */

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Date;


@Controller
public class HelloController {
 @Autowired
    private StudentPropertise studentPropertise;

    @RequestMapping("/hello")
    @ResponseBody
    public String hello() {
        return "Hello Spring Boot!";
    }
    @RequestMapping("/stuinfo")
    @ResponseBody
    public String stuinfo() {
        return studentPropertise.getName()+"---+++"+studentPropertise.getAge();
    }

    @RequestMapping("/now")
    public  String now(Model model) {
        model.addAttribute("time",new Date());
        return "now";
    }
}
最近下载更多
Qolmen  LV12 1月3日
李亮  LV19 2023年3月7日
微信网友_6130924632494080  LV1 2022年9月13日
Ty  LV10 2022年5月31日
赵雁斌  LV1 2021年4月24日
zhoujunyu  LV14 2021年4月1日
welove  LV3 2020年6月12日
huhuichun  LV1 2020年5月8日
aqsx1598  LV7 2020年1月26日
疾风前行  LV5 2020年1月1日
最近浏览更多
Qolmen  LV12 1月3日
fuyouou  LV5 2023年6月18日
skook7  LV2 2023年6月1日
柠熙非兮886 2023年5月29日
暂无贡献等级
李亮  LV19 2023年3月6日
bluece 2023年1月12日
暂无贡献等级
5212991314 2022年10月26日
暂无贡献等级
wpf211314 2022年9月15日
暂无贡献等级
77777777朱朱朱 2022年9月13日
暂无贡献等级
微信网友_6130924632494080  LV1 2022年9月13日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友