首页>代码>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日
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日