- 博客(42)
- 收藏
- 关注
原创 【分析阅读】分析阅读的三个阶段
一、分析阅读的第一个阶段:找出一本书在谈些什么的规则(1)依照书的种类与主题来分类(2)使用最简短的文字说明整本书在谈些什么(3)将主要部分按顺序与关联性列举出来。将全书的大纲列举出来,并将各个部分的大纲也列举出来(4)确定作者想要解决的问题二、分析阅读的第二个阶段:诠释一本书的内容规则(5)诠释作者的关键字,与他达成共识(6)由最重要的句子中,抓住作者的重要...
2019-08-27 20:15:00 1246
原创 【spring-boot】[An error happened during template parsing (template: “class path resource...
thymleaf遇到错误:ERROR ---o.s.b.a.w.s.e.ErrorMvcAutoConfiguration$StaticView--- Cannot render error page for request [/toRealTimeAlgoConfiger_1_html] and exception [An error happened during template ...
2019-08-24 22:29:00 3208
原创 【spring-boot】为什么“字符串值“.equels(str变量)比 str变量.equels(“字符串值“)要更好...
当我们在写JAVA判断时,经常会使用到字符串的判断,因为大部分的业务逻辑中需要使用到字符串,但是我们可能看到很多的代码都是使用"字符串值".equels(str变量) 这种方式进行判断,而不是str变量.equels("字符串值")这里主要是因为:"某具体字符串".equals(str变量)这种写法是保证了当str变量为null的时候,程序不会抛出空指针异常...
2019-08-24 21:06:00 337
原创 【spring-boot】spring-boot结合thymleaf模板时,跳转到一个页面出现css解析不出来的错误...
请看错误:1.当前所在页面:页面中有的功能:当我点击暂停时,会提交一个form表单给spring-boot后台处理,处理完之后再返回到该页面,我们可以看到,没有css看我们的form表单提交的请求,如下:/algo/1/stop?pid=${pid}提交到controler处理请求是一个多级目录,这种情况下,好像是会出现解析css错误的情况的,...
2019-08-17 15:51:00 150
原创 【spring-boot】non-compatible bean definition of same name and class
今天遇到了一个错误,non-compatible bean definition of same name and class查了一下百度,是 类名重复冲突,改掉即可以了。将其改成实现的service接口即可。一个博客的回答。...
2019-08-16 14:50:00 3309
原创 【spring-boot】Cannot determine value type from string 'xxxxxx';
今天在运行昨天还能运行的springboot代码时,发现不能运行了,出现了一个错误,Cannot determine value type from string 'xxxxx';弄了很久终于还是解决了,看到了一天博客,豁然开朗。from:https://blog.csdn.net/qq_34729698/article/details/89510827在该实体类中创建一个无惨...
2019-08-15 11:36:00 2690
原创 【spring-boot】thymleaf如何获取session中的值
<form method="get" th:action="@{/logout_html}" id="userinfo"> <button type="submit" class="btn btn-link">退出</button> <b style="display:inline;" th:text="'用户名:' + ${se...
2019-08-13 09:28:00 2995
原创 【spring-boot】Invalid bound statement (not found): com.springboot.mapper.RealtimeMapper.selectAll
解决:Invalid bound statement (not found): com.springboot.mapper.RealtimeMapper.selectAll遇到这种问题,首先检查mybatis配置文件中是否已经添加对应的mapper JAVA类文件红色方框中需要对应自己都Mapper类...
2019-08-12 10:49:00 400
原创 【spring-boot】spring-boot返回的json格式数据的排序规则
springboot返回的数据,默认是json格式返回,json中的key-value是按默认字母顺序排序的建议:如果想让计数统计排序在前,可以在取名上动手脚。如下所示:排序后:排序前:...
2019-08-12 10:43:00 3253 1
原创 【spring-boot】spring-boot通过浏览器发送json格式数据,controler的处理
1.我们使用Postman软件工具向spring-boot发送post形式的数据,如下:2.再来看一下我们的实体类的代码:RespCode.javapackage com.springboot.cib_hk.bean;import lombok.Data;/** * @author zhuhonggen * @version 创建时间:201...
2019-08-10 14:37:00 450
原创 【spring-boot】Could not find result map ‘com.springboot.cib_hk.bean.Users‘ referenced from ‘co...
解决:Could not find result map 'com.springboot.cib_hk.bean.Users' referenced from 'com.springboot.cib_hk.mapper.UsersMapper.selectByUsername'打开mybatis.xml文件,作如下修改:...
2019-08-10 09:16:00 350 1
原创 【学习】理财书单
这里也是根据一个公众号推荐的书单,我这里做了一个链接,可以直接链接到京东查看,但是我放的都是自营,可能会有点贵,可以自行选择便宜的版本购买。推荐次数书名购买链接20《富爸爸穷爸爸》京东17《小狗钱钱》京东10《邻家的百万富翁》京东9《财务自由之路》京东...
2019-08-08 23:15:00 440
原创 【spring-boot】Restful中的CRUD请求方式
传统请求方式和Restful方式的对比操作传统Restful查询getEmp/emp,Get添加addEmp?xxx/emp,Post删除deletEmp?xxx/emp,Delete修改updateEmp?xxx/emp,Put...
2019-08-08 21:17:00 490
原创 【spring-boot】spring-boot项目中,实现日志记录功能(slf4j)
spring-boot通过slf4j+logback实现日志记录功能,这里通过spring-boot的测试类,查看日志效果SpringBootLogApplicationTests.java代码如下:package com.springboot;import org.junit.Test;import org.junit.runner.RunWith;import...
2019-08-08 20:52:00 655
原创 【spring-boot】spring-boot项目中,通过thymleaf实现登录功能,这里是一个登录拦截器的参考代码...
我们在实现网页登录操作时,需要对网页进行保护(权限控制),将没有没有登录到请求拦截在系统之外,那么这里可以通过一个拦截器实现该功能以下是LoginHanderInterceptor.java的参考代码:package com.springboot.conponent;import org.springframework.web.servlet.HandlerInter...
2019-08-08 20:40:00 272
原创 【spring-boot】spring-boot项目中,通过JAVA配置类形式配置前台代码都重定向转发...
以下是MyMvcConfig.java配置类的代码,可供参考:package com.springboot.config;import com.springboot.conponent.LoginHanderInterceptor;import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoC...
2019-08-08 20:38:00 329
原创 【Linux】Linux常用命令以及使用方法(updating)
1.yumyum install 三方库名--》例如:yum install docker :安装dockeryum remove 三方库名--》例如:yum remove docker-* :卸载与dockers有关的所有文件yum update:更新Linux内核版本--》可通过uname -r命令查看当前内核版本:...
2019-08-08 11:25:00 132
原创 【Linux】通过Mac终端连接虚拟机(ssh root@192.168.31.230)
首先我们得配置虚拟机的网络连接:点击那个两个电脑的按钮:选择设置网络,进入到以下界面:配置完之后,我们需要重启网络服务: 1.可以直接重启虚拟机重启网络服务 2.可以输入:service network restart命令重启网络服务重启服务之后,查看虚拟机IP地址,输入命令:ip addr这里有一个需要注意的地方: 如我我们查看的enp0s...
2019-08-08 10:52:00 2014
原创 【spring-boot】使用模板时出错:Error resolving template template might not exist or might not be accessible...
解决:Error resolving template template might not exist or might not be accessiblethymleaf模板的HTML文件必须是HTML5版本的文件,如果不是的话,那就从idea重新创建一个HTML5文件,然后将之前的文件内容拷贝一份到新创建的HTML5文件中。...
2019-08-06 21:37:00 2311 1
原创 【spring-boot】通过mybatis的配置文件方式查询数据库中的多条数据
需求:当我们相同要通过mybatis-{table}-mapper.xml的方式执行类似:select * from users;的语句时,会查询到很多条数据,那么我们该如何处理呢。mybatis-score-mapper.xml文件如下:<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper ...
2019-08-06 16:00:00 958
原创 【spring-boot】使用lombok依赖简化实体类的getter和setter等方法
<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.16.20</version></de...
2019-08-06 15:46:00 531
原创 【spring-boot】mybatis-{table_name}-mapper.xml的编写
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"><mapper namespace="org.myba...
2019-08-06 11:21:00 372
原创 【spring-boot】mybatis-config.xml的模板
<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><configuration>...
2019-08-06 11:19:00 201
原创 【spring-boot】spring-boot导入mybatis依赖
<!--这是mybatis依赖--><dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1....
2019-08-06 11:07:00 4512
原创 【spring-boot】查看导入的依赖的属性和默认配置类
从Exteral Libraries文件夹下,找到spring-boot-autoconfigure-2.1.6.RELEASE.jar包,查看相应的导入依赖包的属性和默认配置情况。这里以查看thymleaf为例:部分JAVA代码如下:@ConfigurationProperties( prefix = "spring.thymeleaf")public ...
2019-08-06 10:59:00 567
原创 【spring-boot】thymleaf版本错误
spring-boot项目导入thymleaf模板依赖时,出错:org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration$ThymeleafDefaultConfiguration.templateEngine(ThymeleafAutoConfiguration.java:153)去掉pom.x...
2019-08-06 10:53:00 269
原创 【spring-boot】在编写spring-boot项目时,用到的一些JAVA技术以及介绍
Arrays.asList:将一个数组转换成list数据结构的对象,参考博客
2019-08-06 10:35:00 343
原创 【spring-boot】spring-boot使用JPA中文乱码问题:Incorrect string value: ‘\xE7\x94\xB7‘ for column ‘sex‘ at row 1
错误:Incorrect string value: '\xE7\x94\xB7' for column 'sex' at row 1解决方案:
2019-08-05 19:11:00 2674 4
原创 【spring-boot】spring-boot使用JPAJ进行数据访问时,提示:org.hibernate.InstantiationException: ...
错误:org.hibernate.InstantiationException: No default constructor for entity: : com.springboot.jpa.entity.User解决方案: 在相应的实体类中,创建一个无参数的构造方法即可。@Entity@Table(name = "tb_users")public class Use...
2019-08-05 18:42:00 155
原创 【spring-boot】spring-boot使用mybatis的配置文件进行数据访问
两个配置文件:如图所示,在resources文件夹下创建两个配置文件,可以放在不同的目录下面,最后会在yml配置文件中指定路径mybatis-config.xml:<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD...
2019-08-05 11:44:00 149
原创 【spring-boot】spring-boot整合mybatis时,mapper中设置自增主键
spring-boot框架中,当我们在使用mybatis进行数据库操作时,可能需要使用到主键自增的设计,我们在插入数据时,往往就不用插入主键了,那么我们返回数据提示的时候,如何获得那个自增主键呢。mapper里面的代码:UserMapper.java@Mapperpublic interface UserMapper { @Options(useGenerated...
2019-08-05 10:25:00 1928
原创 【spring-boot】spring-boot使用log4j框架时,提示警告-》log4j:WARN Please initialize the log4j system properly....
解决方法:在resources文件夹下,创建一个配置文件:log4j.properties内容如下:log4j.rootLogger=WARN, stdoutlog4j.appender.stdout=org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout=org.apache.log4j.PatternLa...
2019-08-05 09:48:00 1477
原创 【spring-boot】spring-boot操作MySQL数据库时导入的pom.xml依赖
<!--MySQL依赖 --><dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId></dependency><dependency> <g...
2019-08-05 09:34:00 1703
原创 【spring-boot】spring-boot整合dDruid时的application.yml配置文件
spring: datasource: # 数据源基本配置 username: root password: root driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/test?serverTimezone=UTC&use...
2019-08-05 08:55:00 1308
原创 【spring-boot】spring-boot整合Druid时,编写的配置文件
package com.springboothelloworld.com.springboothelloworld.config;import com.alibaba.druid.pool.DruidDataSource;import com.alibaba.druid.support.http.StatViewServlet;import com.alibaba.druid....
2019-08-05 08:51:00 123
原创 【spring-boot】spring-boot整合Druid时,需要导入的依赖
<!--添加Druid依赖--> <dependency> <groupId>com.alibaba</groupId> <artifactId>druid</artifactId> <version>1.0.20&...
2019-08-05 08:47:00 1260
原创 【spring-boot】编写spring-boot项目常用到的技术套路
整合Druid时遇到的错误:Failed to bind properties under 'spring.datasource' to javax.sql.DataSource: 整合Druid时需导入的依赖:Druid pom.xml依赖 整合Druid时编写的配置文件:config/DruidConfig.java 整合Druid时的yml配置文件:application....
2019-08-05 08:42:00 798
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人