![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SpringBoot
清雨未尽时
清雨入清晨,午时未阳依。
百望夕阳暮,如梦未尽时。
展开
-
Controller返回view错误处理
错误提示:1.avax.servlet.ServletException: Circular view path [privacy]: would dispatch back to the current handler URL [/app/web/privacy] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name gen原创 2020-10-28 15:59:20 · 437 阅读 · 0 评论 -
BCryptPasswordEncoder 用户登录密码加密后对比错误处理
将用户登录将密码加密后与数据库中的用户加密 密码对比始终是错误的代码如下: BCryptPasswordEncoder encoder = new BCryptPasswordEncoder(); String pwd = encoder.encode(user.getPassword()); if(user1.getPassword().equals(pwd) == false){ return "密码错误"; }处理方法 BCryp.原创 2020-06-12 16:20:07 · 4658 阅读 · 0 评论 -
Java 爬虫实战二
一、项目需要对某类网站的数据进行数据采集 对主要数据采集点每天定时开启任务 对部分数据采用周六日开启任务采集 将数据写入数据库 对已经采集对信息进行更新处理二、采用技术项目框架Spring Boot 爬虫工具:webmagic 数据库:Mysql 定时器:@Scheduled 开启 cron在心解析地址:http://cron.qqe2.com/ 网页分析:...原创 2020-04-01 12:47:44 · 396 阅读 · 0 评论 -
Java 爬虫实战
一、项目需要对某类网站的数据进行数据采集 采用每天定时开启任务 将数据写入数据库 对已经采集对信息进行跟新处理二、采用技术项目框架Spring Boot 爬虫工具:webmagic 数据库:Mysql 定时器:@Scheduled 开启 cron在心解析地址:http://cron.qqe2.com/ 网页分析:Goole Chrome 语句解析采用:XP...原创 2020-03-30 16:24:15 · 675 阅读 · 0 评论 -
org.springframework.http.converter.HttpMessageNotReadableException: Required request body 错误处理
[org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing这是因为@RequestBody 不支持get方法所致@GetMapping("/doQuery")public RespPageBean getUsersByPage(@Reques...原创 2020-03-22 14:50:33 · 9579 阅读 · 0 评论 -
Vue单页面开发实例之数据列表+分页+时间筛选+类型选择及后台实现
一、描述 页面主要功能是: 通过列表展示用户意见反馈信息, 通过类型查询数据 通过时间筛选查询数据 点击缩略图展示大图二、Element--Ui组件的选用 el-table:数据展 el-select : 类型选择 el-data-picker :筛选时间日期 el-image:图片加载 el-dialog:查看大...原创 2020-03-21 01:37:49 · 1522 阅读 · 0 评论 -
Failed to convert from type [java.lang.String] to type [java.util.Date] for value 错误处理
Vue 前端向Java后台传递时间格式数据,进行数据查询,出现这个错误信息Resolved [org.springframework.web.method.annotation.MethodArgumentTypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'jav...原创 2020-03-20 16:06:38 · 12607 阅读 · 1 评论 -
Error:Maven Resources Compiler: Maven project configuration required for module ' isn't invalid
Compilation of Maven projects is supported only if external build is started from an IDE.原创 2020-03-07 22:30:45 · 470 阅读 · 0 评论 -
idea 添加git
1.创建项目2.检查git是否安装正确.git inittouch REAMME.md git add REAMME.md git remote add origin ssh://kangxg@192.168.0.99:29418/zhaizhu/server.gitgit commit -m "first commit" git push -u or...原创 2020-03-07 22:27:51 · 383 阅读 · 0 评论 -
Nginx负载均衡
1.安装Nginxhttps://blog.csdn.net/kangguang/article/details/1043562582.进入/usr/local/etc/nginx目录配置nginx.conf1、upstream 表示配置上游服务器2、kangxg.com表示服务器集群的名字,这个可以随意取名字3、upstream 里边配置的是一个个的单独服务4、weight 表...原创 2020-03-06 14:42:58 · 81 阅读 · 0 评论 -
flyway数据库迁移设置实例
1.添加依赖<dependency> <groupId>org.flywaydb</groupId> <artifactId>flyway-core</artifactId></dependency>2.在项目src->main->resource目录下 创建db_migratio...原创 2020-03-06 01:38:21 · 739 阅读 · 0 评论 -
idea 创建多个module 及配置
一、创建一个根工程二、创建一个Spring Boot Modlue1.创建2.创建完成后目录为5.设置 multiple 下的pom<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" ...原创 2020-03-06 01:27:53 · 2976 阅读 · 0 评论 -
java url字符串域名获取
方法1.获取顶级域名 public String getDomainForUrl(String url){ String domainUrl = null; if (url == null) { return null; } else { Pattern p = Pattern.compil...原创 2020-03-04 14:27:49 · 1667 阅读 · 0 评论 -
HtmlCleaner解析HTML
HtmlCleaner是一款高效的HTML解析器,支持 Xpath语法提取HTML中的节点或元素。1.添加依赖<dependency> <groupId>net.sourceforge.htmlcleaner</groupId> <artifactId>htmlcleaner</artifactId> <...原创 2020-03-03 15:12:20 · 1176 阅读 · 0 评论 -
Xpach语法
Xpach语法 表达式 描述 案例 案例含义 codename 选取此节点等所有子节点 body 选取<body>元素等所有 子节点 / 从根节点选取 /html 选取根节点<html> // 从选择等当前选择文件中的 子节点,而不考虑它们的位置 //div 选取所...原创 2020-03-03 15:02:37 · 357 阅读 · 0 评论 -
重写log4j HTMLLayout及日志信息自定义处理
衔接https://blog.csdn.net/kangguang/article/details/104589491中中文字符乱码问题,进行重写HTMLLayout1.添加HTMLLayout的子类package com.kxg.spadminclient;import java.text.SimpleDateFormat;import org.apache.log4j.HTM...原创 2020-03-01 12:33:27 · 504 阅读 · 0 评论 -
log4j 配置 参数简介
1.日志优先级从低到高分为DEBUG:调试,一般作为最低级别,trace基本不用。 INFO:输出重要的信息,使用较多 WARN:警告, ERROR:错误信息 FATAL:重大错误,会导致程序中断。 如果 级别定位INFO 那么高于它的级别的日志 信息都可以输出,低于的将无法输出PatternLayout自定义日志布局:%d{yyyy-MM-dd HH:mm:ss, ...原创 2020-02-29 23:18:13 · 610 阅读 · 0 评论 -
Idea Spring Boot log4j的使用
1.添加依赖<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version></dependency>2.在resource 目录下创建 log4j.proper...原创 2020-02-29 22:59:21 · 806 阅读 · 0 评论 -
Tomcat 部署war 包
1.在Idea Spring Boot 中设置的端口信息server.port=9003 这时候不要关注它,访问端口统一 使用Tomcat设置的端口(如 8080)2.将打成的war包放入tomcat 安装目录中的 webapps中 tomcat会自动解压,解压完成后,即可通过浏览器进行访问 了部署就这么简单的完成了...原创 2020-02-29 00:47:24 · 402 阅读 · 0 评论 -
Idea Spring Boot 打成war 包
创建项目时采用的是jar形式,这时候想用传统的war包形式部署,修改配置如下1.在npm.xml修改packaging 和tomcat 依赖 <groupId>com.kxg</groupId> <artifactId>spadminclient</artifactId> <version>0.0.1-SNAPSHOT<...原创 2020-02-29 00:41:54 · 181 阅读 · 0 评论 -
spring-boot-admin-starter-server + security认证 及上传云端docker配置
一、spring-boot-admin-starter-server 项目配置1.依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </d...原创 2020-02-28 21:58:05 · 2259 阅读 · 0 评论 -
Spring Boot 整合 AMQP
RabbitMQ 安装https://blog.csdn.net/kangguang/article/details/104551284一.添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-w...原创 2020-02-28 16:07:25 · 2532 阅读 · 0 评论 -
Channel shutdown: channel error; protocol method 错误处理
错误信息Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'kxg-fanout' in vhost '/': r...原创 2020-02-28 14:06:31 · 40045 阅读 · 3 评论 -
org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused
使用 AMQP RabbitMQ 出现的错误org.springframework.amqp.AmqpConnectException: java.net.ConnectException: Connection refused这个错误是与 AMQP 服务 连接错误所致spring.rabbitmq.host=localhostspring.rabbitmq.post=5672...原创 2020-02-28 13:23:46 · 1565 阅读 · 0 评论 -
Mac RabbitMq的安装和使用
官网地址:http://www.rabbitmq.com/download.html一、安装1.homebrew安装brew install rabbitmq2.安装完成后==> CaveatsManagement Plugin enabled by default at http://localhost:15672Bash completion has bee...原创 2020-02-28 11:41:39 · 1430 阅读 · 0 评论 -
Spring Batch 批处理第二版本
上一版本在写入上有点问题,并且不能完全手动设置处理文件1、添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-batch</artifactId></dependency>&l...原创 2020-02-28 01:39:26 · 290 阅读 · 0 评论 -
Spring Boot 批处理
Spring Batch是一个开源 的、全面的、轻量级的批处理框架,通过Spring Boot 可以实现强大的批处理应用程序开发。Spring Batch提供了ItemReader、ItemProcessor和ItemWriter来完成数据的读取、处理及写出操作,并且可以将批处理的执行状态 持久化到数据库中。https://spring.io/projects/spring-batch...原创 2020-02-27 00:06:19 · 1748 阅读 · 0 评论 -
Spring Boot Validation校验注解参考表
校验注解表 校验注解 注解的元素类型 描述 @AssertFalse Boolean、boolean 被注解的元素值必须为 false @AssertTrue Boolean、boolean 被注解的元素值必须为 true @DecimalMax BigDecimal、BigInteger、CharSequence、byte、short、in...原创 2020-02-26 16:31:43 · 2424 阅读 · 0 评论 -
Spring Boot 数据校验
一、普通校验1.添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId></dependency>2.创建User类publi...原创 2020-02-26 15:59:06 · 293 阅读 · 0 评论 -
Spring Boot properties 文件创建及中文乱码处理
一、文件创建输入名称即可二、中文乱码处理原创 2020-02-26 15:35:29 · 275 阅读 · 1 评论 -
cron表达式
在线Cron表达式生成器地址:http://cron.qqe2.com/一、结构 corn从左到右(用空格隔开):秒 分 小时 月份中的日期 月份 星期中的日期 年份二、各字段的含义字段 允许值 允许 的特殊字符 秒(Seconds) 0~59的整数 , - * / 四个字符 分(Minutes) 0~59的整数 , - * / ...原创 2020-02-26 12:50:21 · 137 阅读 · 0 评论 -
Spring Boot Quartz使用
Spring Boot 中集成Quartz 和 Spring 集成Quartz比较相似,主要提供 三个bean:JobDetail、Trigger、SchedulerFactory1.添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>s...原创 2020-02-26 12:36:39 · 285 阅读 · 0 评论 -
Quartz使用错误A component required a bean named 'MyFirstJob' that could not be found
错误信息***************************APPLICATION FAILED TO START***************************Description:A component required a bean named 'MyFirstJob' that could not be found.Action:Consider de...原创 2020-02-26 12:17:39 · 378 阅读 · 0 评论 -
Spring Boot 定时任务
定时统计订单数、数据库备份、定时发送短信和邮件、定时统计博客访客等,简单的定时任务可以通过Spring中的@Schedule来实现1.在启动类上上添加@EnableScheduling注解开启定时任务@EnableSchedulingpublic class SpadminApplication { public static void main(String[] args) {...原创 2020-02-26 11:34:14 · 143 阅读 · 0 评论 -
Spring Boot 监控信息邮件报警通知
在Spring Boot Admin Server中 进行设置1.添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency...原创 2020-02-26 00:19:58 · 2537 阅读 · 0 评论 -
新浪邮箱开启POP3/SMTP服务
1.点击设置默认是关闭的,点击开启后会提示通过手机发送验证信息,手机发送信息验证完毕后,点击确定会生成授权码2.查看SSL的配置信息点击如何设置POP服务...原创 2020-02-26 00:11:04 · 6941 阅读 · 0 评论 -
Spring Boot 监控信息可视化
使用spring-boot-starter-actuator监控太过于麻烦,而且通过返回的JSON数据查看起来非常不方便,使用Spring Boot 中提供的监控信息管理端,用来实现监控信息的可视化,可以快速查看系统运行状况,再不用一个一个接口地调用接口。具体配置:一、设置Spring Boot Admin Server1.添加依赖<dependency> <...原创 2020-02-25 23:36:39 · 1138 阅读 · 0 评论 -
spring-boot-admin-starter-server 错误处理
Spring Boot 使用监控信息可视化,以便快速查看系统运行情况主要版本:org.springframework.boot 2.2.4 spring-boot-admin-starter-server 2.0.6运行出现Description:Method requestMappingHandlerAdapter in org.springframework...原创 2020-02-25 22:32:17 · 8625 阅读 · 4 评论 -
Spring Boot OAuth2 使用实践
一、添加依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependenc...原创 2020-02-22 17:08:35 · 381 阅读 · 0 评论 -
Spring Boot 基于数据库认证
一、设计数据库表1.库security2.user表3.role表4.user_role表Bcrypt密码生成计算器https://www.jisuan.mobi/p163u3BN66Hm6JWx.html二、添加依赖<dependency> <groupId>org.springframework.bo...原创 2020-02-22 00:28:58 · 414 阅读 · 0 评论