package com.sb.demo.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
import com.sb.demo.bean.Demo;
import com.sb.demo.service.DemoService;
@RestController
public class DemoController {
@Autowired
private DemoService demoService;
@RequestMapping("/likename")
public List<Demo> likeName(String name) {
return demoService.likeName(name);
}
@RequestMapping("/index")
public ModelAndView index(String name) {
List<Demo> list = demoService.likeName(name);
int size = list.size();
int id = list.get(size - 1).getId();
ModelMap model = new ModelMap();
model.addAttribute("id", id);
return new ModelAndView("index", model);
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
SpringBoot简易Demo(整合mybatis)
共12个文件
java:6个
jsp:2个
xml:2个
需积分: 10 7 下载量 127 浏览量
2017-11-07
16:57:48
上传
评论
收藏 6KB RAR 举报
温馨提示
SpringBoot搭建的简易Demo(整合mybatis),使用maven构建
资源推荐
资源详情
资源评论
收起资源包目录
SpringBootPro.rar (12个子文件)
src
main
webapp
WEB-INF
jsp
showUser.jsp 241B
web.xml 222B
resources
index.jsp 57B
resources
templates
index.html 367B
application.yml 398B
java
com
sb
demo
service
DemoService.java 427B
controller
DemoController.java 952B
mapper
DemoMappper.java 447B
bean
Demo.java 430B
config
mybatis
MyBatisConfiguration.java 660B
SpringBoot.java 467B
pom.xml 2KB
共 12 条
- 1
资源评论
不爱吃土豆尼
- 粉丝: 3233
- 资源: 41
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功