![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Spring Boot
MR_非凡
这个作者很懒,什么都没留下…
展开
-
springboot集成mybatis完成分页功能
分页功能的实现我是直接使用的mybatis中封装的分页插件,这个比较简单,正常写查询就好了,在控制器中接收传来分页的@RequestParam(value="nowPage",required=false,defaultValue="0") Integer nowPager每页显示多少条 PageHelper.startPage(nowPager, 5);控制器: //显示所有用户每页显示...原创 2019-12-20 14:19:02 · 405 阅读 · 0 评论 -
SpringBoot实现HandlerInterceptor拦截器的接口没有需要重写的方法也不报错是怎么回事
以前实现HandlerInterceptor接口,总会提示需要实现3个方法(preHandle、postHandle、afterCompletion)。现在没有出现提示。原因:这是Java8的新特性——default方法/defender方法。HandlerInterceptorf接口的方法全部用default来修饰。导致没有提示快捷键Alt+Enter提示重新方法了,在需要重写方法时需可以直...原创 2019-12-05 15:05:12 · 1349 阅读 · 0 评论 -
使用idea创建Spring Boot项目
1、 选择文件创建: file->new ->Project->Spring Initializr看到以下界面,选取蓝色标记的一列,注意的是我们也可以使用它的默认网站进行生成,网址就是http://start.spring.io。选中点击next即可。2、在Group栏输入组织名,Artifact就是项目名。其它选择默认就好,直接Next3、 目前我们只需要勾选上WEB...原创 2019-07-01 11:09:24 · 825 阅读 · 0 评论 -
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could
Spring boot启动不了出现Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver class……这种情况因该是驱动的...原创 2019-07-19 16:17:01 · 396 阅读 · 0 评论 -
SpringBoot在控制器中处理json数组集合,并映射到html页面遍历方法
上次处理这种数据使用的js,但在使用的时很多时候都需要在后台进行处理,在后台处理数据也比较安全,想了好久终于有解决方法了 {"code": 0, "data": [{"create_time": "2019-09-05 17:33:22", "lib_id": 7, "lib_name": "asdf", "lib_type": 2, "picture_no": 0, "update_t...原创 2019-09-05 18:10:47 · 1641 阅读 · 0 评论 -
SpringBoot通过@RequestParam接收前端表单传来的数据
就像这样的界面在前台向控制器中传输数据,使用功能form表单进行传值,使用@RequestParam注解在控制器中接收传过来的值,注意,name属性一定要和控制器中的@RequestParam相同 要不然接收不到还报错HTML中页面代码:<div class="panel admin-panel margin-top" id="add"> <div class="...原创 2019-09-07 11:04:44 · 27698 阅读 · 1 评论 -
Spring Boot使用重定向从控制器中的一个方法跳转到另一个方法
我在添加之后需要跳转到显示页面,需要从控制器中的添加完成后跳转到显示的方法中,使用从定向指定就可实现!! 这个重定向跳转可以跨控制器哦不用关注别的代码 重定向跳转只需要 return "redirect:/target";就可以从控制器中的一个方法跳转到另一个方法/** * * 显示目标库数据 * @param model ...原创 2019-09-11 10:15:38 · 4955 阅读 · 0 评论