java远程debug如何配置tomcat
摘要:
在tomcat的bin/startup.sh中添加: 27780debug的端口 declare -x CATALINA_OPTS="-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server
springboot中解析JSON参数
摘要:
解析psot请求中的JSON参数 代码: Map<String, String> attrMap = new HashMap<String, String>(); BufferedReader streamReader = null; try { streamReader = new Buffere
转换工具类
摘要:
工具类 package com.cog.utils; import java.lang.reflect.Field; import java.util.HashMap; import java.util.List; import java.util.Map; /** * 转换工具类 * @autho
yarn install报错
摘要:
方法1.修改yarn源为taobao源 yarn config set registry https://registry.npm.taobao.org/ 验证 yarn config get registry 方法2.PHANTOMJS_CDNURL=http://npm.taobao.org/m
RocketMQ特性
摘要:
特性(features) 1 订阅与发布 消息的发布是指某个生产者向某个topic发送消息;消息的订阅是指某个消费者关注了某个topic中带有某些tag的消息,进而从该topic消费数据。 2 消息顺序 消息有序指的是一类消息消费时,能按照发送的顺序来消费。例如:一个订单产生了三条消息分别是订单创建
RocketMQ基本概念
摘要:
基本概念 1 消息模型(Message Model) RocketMQ主要由 Producer、Broker、Consumer 三部分组成,其中Producer 负责生产消息,Consumer 负责消费消息,Broker 负责存储消息。Broker 在实际部署过程中对应一台服务器,每个 Broker
RuntimeUtils
摘要:
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.util.LinkedList;impor
Git相关指令
摘要:
查看当前分支记录用于查看分支基于哪个分支创建,必须在本地创建的分支才可以看到 git reflog --date=local --all | grep <branchname>
纯PDFBOX操作pdf(支持中文)
摘要:
# 话不多说直接看实例 <dependency> <groupId>org.apache.pdfbox</groupId> <artifactId>pdfbox</artifactId> <version>2.0.13</version> </dependency> public class Col
类字节码文件扫描工具,可以扫描jar包
摘要:
/** * @description :类字节码文件扫描工具,可以扫描jar包 */ public class Utils { //从包路径下扫描 public static Set<Class> getClasses(String packagePath) { Set<Class> res = n
类字节码文件扫描工具,不可扫描jar包
摘要:
/** * @description :类字节码文件扫描工具,不可扫描jar包 */ public class ClassScanner { /** * 获得包下面的所有的class * * @param * @return List包含所有class的实例 */ public static Lis
RocketMQ的建议
摘要:
建议 1 生产者 1.1 发送消息注意事项 1 Tags的使用 一个应用尽可能用一个Topic,而消息子类型则可以用tags来标识。tags可以由应用自由设置,只有生产者在发送消息设置了tags,消费方在订阅消息时才可以利用tags通过broker做消息过滤:message.setTags("Tag
RocketMQ实例
摘要:
样例 目录 1 基本样例 1.1 加入依赖: 1.2 消息发送 1、Producer端发送同步消息 2、发送异步消息 3、单向发送消息 1.3 消费消息 2 顺序消息样例 2.1 顺序消息生产 2.2 顺序消费消息 3 延时消息样例 3.1 启动消费者等待传入订阅消息 3.2 发送延时消息 3.3
java mailutil(java代码发送邮件)
摘要:
import javax.mail.*; import javax.mail.internet.*; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Properties; public class
js实现头像转动效果
摘要:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title> </title> </head> <style type="text/css"> #showImg{ width: 200px; height: 200px;
spring boot配置分页助手
摘要:
1.pom <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.3</version> </depende
跨域问题解决方案
摘要:
1 import org.springframework.core.annotation.Order; 2 import org.springframework.stereotype.Component; 3 import org.springframework.web.filter.OncePer
比较有意思的算法思路
摘要:
1.较大分组的位置(相同字符串的下标集合长度>=3) public static List<List<Integer>> largeGroupPositions(String s){ List<List<Integer>> res = new ArrayList<>(); //相同字符串左边边界 i
java int
摘要:
1.整数反转 /** * 整数反转 * @param x * @return */ public static int reverse(int x) { long res = 0; while (x != 0) { res = res * 10 + x % 10; x /= 10; } return
java String
摘要:
1.indexOf() /** * Returns the index within this string of the first occurrence of the * specified substring. * * <p>The returned index is the smallest
java日期相关
摘要:
1.获取当前月第一天 /** * 获取当前月的第一天 * * @return */ public static Date getFirstDayOfMonth() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.
SpringBoot实现简单socket服务端
摘要:
1.启动类 @SpringBootApplication public class serverApplication { public static void main(String[] args) { SpringApplication.run(serverApplication.class,
fastdfs javaclient
摘要:
1.pom 1 <dependency> 2 <groupId>net.oschina.zcx7878</groupId> 3 <artifactId>fastdfs-client-java</artifactId> 4 <version>1.27.0.0</version> 5 </depende
centos7.3[64bit]安装Docker
摘要:
# 1、yum 包更新到最新 yum update # 2、安装需要的软件包, yum-util 提供yum-config-manager功能,另外两个是devicemapper驱动依赖的 yum install -y yum-utils yum install -y device-mapper-p
JAVA Poi工具类
摘要:
Apache POI 简介是用Java编写的免费开源的跨平台的 Java API,Apache POI提供API给Java程式对Microsoft Office(Excel、WORD、PowerPoint、Visio等)格式档案读和写的功能。POI为“Poor Obfuscation Impleme
java常用IO
摘要:
1.java递归删除某一文件夹下的文件 1 /** 2 * 递归删除文件 3 * @param file 4 */ 5 public static void delAll(File file) { 6 //获取包含file对象对应的子目录或者文件 7 File[] b = file.listFile
fastjson反斜杠问题
摘要:
遇到JSON串有反斜杠就把它转成对象输出,具体什么对象自己分析一下,以下为示例: String genData = mockDataService.creatFile(dataMap); Map respMap = JSON.parseObject(genData, new TypeReferenc
SpringBoot集成nacos示例
摘要:
一、引入pom <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId> <version>2.2.1.RELEASE</v