- 博客(43)
- 资源 (1)
- 收藏
- 关注
原创 springboot log print
INFO ACCEPT DENY %-4relative [%thread] %-5level %logger{30} - %msg%n testFile.log true %-4relative [%thread] ...
2021-08-06 17:37:33
104
原创 jboss jndi setup
https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.3/html/how_to_configure_server_security/securely_storing_credentials@ResourceEnvironment env;env.getRequiredProperty(“jndiname”); // get the jndi from cloud pr
2021-08-02 17:00:41
95
原创 2021-07-28 tomcat远程调用
Windows下进入目录下的bin目录,编辑打开startup.bat在前面添加:SET CATALINA_OPTS=-server -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8089完成一行,不要断开。Linux下(CentOS)在catalina.sh中的首行添加:CATALINA_OPTS="-Xdebug -Xrunjdwp:trans
2021-07-28 10:02:27
128
原创 sql udpate select
t1.column1 ( value set to ) t2.column update table1 t1 set t1.column1=(selectt2.column from table2 t2 where t1.xx= t2.xx and t1.xxx is null )where t1.xxx is null
2021-06-30 14:06:46
80
原创 file upload
@RequestMapping(value = "/upload") @ResponseBody public void upload( @RequestParam(value = "upload", required = false) MultipartFile file , HttpServletRequest request) throws Exception {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
2021-06-29 14:02:51
45
原创 以太网适配器 VirtualBox Host-Only Network:
控制面板\网络和 Internet\网络连接\ virtualbox 必须配置成桥接 网络 , 主机才可以访问虚拟机的服务端口
2021-06-02 10:35:48
2636
原创 java recursive tree.
public List<LinkedHashMap<String, Object>> queryTree() { Map<String, Object> paramMap = new HashMap<>(); paramMap.put("pid",0); List<LinkedHashMap<String, Object>> linkedHashMaps = TypeMapper .queryType(par...
2021-05-13 13:26:28
150
原创 spring cloud schedulelock
@Configuration@EnableScheduling@EnableSchedulerLock(defaultLockAtMostFor = "PT30S")public class ShedlockConfig { /** * Jedis作为分布式锁提供者 * * @return */ @Bean public LockProvider lockProvider(Environment environment) { JedisPoolConfig jedisPo
2021-05-12 13:51:06
138
原创 SpringBoot 传入JSON对象参数
1.请求参数格式必须是正确的JSON。2.在入参中使用注解@RequestBody,用于接收JSON参数,使其自动转对象
2021-05-10 11:26:44
278
原创 install redis on centos 8
// You need tcl 8.5 or newer in order to run the Redis testhttp://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz tar -zxvf tcl8.6.1-src.tar.gz cd tcl8.6.1/ cd unix/ ./configure make make install //安装成功 tcl tar -xzvf redis-5.0.7.tar.gz .
2021-04-08 16:16:37
82
原创 xsteam xml to java object.
FileInputStream file = new FileInputStream(new File("D:\\project\\XX-1.xml")); XStream xstream = new XStream(); XStream.setupDefaultSecurity(xstream); //xStream:Security framework of XStream not initialized, XStream is probably vu...
2021-03-02 17:35:20
68
原创 spring property file chinese encoding.
spring.messages.encoding=UTF-8default encoding is ISO-8859-1new String (“chinese”.getBytes(“ISO-8859-1”),“utf-8”)
2021-01-14 17:35:53
63
原创 java mysqldump backup db
@Scheduled(cron = "0/60 * * * * ? ") public void backupData() { try { String os = System.getProperty("os.name"); System.out.println("os= "+ os ); String backName = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Dat.
2021-01-06 14:08:27
128
2
原创 CentOS8 install telnet
check software is installedrpm -qa | grep telnetrpm -qa | grep xinetdstep2 install yum -y install telnet* yum -y install xinetd step3 open service vi /etc/xinetd.d/telnet # default: yes # description: The telnet server servestelnet sessions
2021-01-06 10:12:17
483
1
原创 centos8 yum using aliyun
modify /etc/yum.repos.droot@localhost yum.repos.d]# cat CentOS-AppStream.repo# CentOS-AppStream.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geo
2021-01-06 09:40:51
113
原创 springboot add resource download .
@Configurationpublic class WebConfig implements WebMvcConfigurer { @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); }put templ
2020-12-16 09:38:28
99
原创 generate the sequence everyday by redis
import javax.annotation.Resource;import org.fh.util.RedisUtil;import org.springframework.scheduling.annotation.Scheduled;import org.springframework.stereotype.Component;@Componentpublic class Service { @Resource RedisTemplate redisTemplate; .
2020-12-14 11:16:48
66
原创 generate pdf and send to outputsteam.
<!-- pdf --> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.5</version> </dependency> <dependency> <groupId>.
2020-12-13 15:00:37
72
原创 QRcode create
<!-- https://mvnrepository.com/artifact/com.google.zxing/core --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.4.0</version> </dep...
2020-12-13 10:15:33
800
原创 itext generate the pdf file and download .
<!-- pdf --> <dependency> <groupId>com.itextpdf</groupId> <artifactId>itextpdf</artifactId> <version>5.5.5</version> </dependency> @RequestMapping("/download2") pub...
2020-12-12 12:49:20
60
原创 wechat
https://mp.weixin.qq.com/debug/cgi-bin/sandboxinfo?action=showinfo&t=sandbox/index测试号管理import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RestController;import me.chanjar.weixin.mp.api.WxMpInMem
2020-12-02 12:35:41
489
原创 quartz
调度器:Scheduler任务:JobDetail触发器:Trigger,包括SimpleTrigger和CronTriggerorg.quartz-schedulerquartz2.3.0public class HelloJob implements Job { @Override public void execute(JobExecutionContext context) throws JobExecutionException { System.out.pri
2020-12-01 09:53:44
90
原创 activiti custom properties
add property in stencilset.json“propertyPackages”:{“name”: “verificationpropertypackage”, //all small case“properties”: [{“id”: “verificationproperty”,“type”: “String”,“title”: “校验属性名”,“value”: “”,“description”: “校验属性名”,“popular”: true}]}
2020-11-30 11:02:16
734
原创 Ubuntu10.20 & centos 8 staticca IP address
Ubuntu:sudo vi /etc/netplan/xxx.yaml:/etc/netplan$ cat 01-network-manager-all.yaml# Let NetworkManager manage all devices on this systemnetwork: renderer: NetworkManager ethernets: enp0s3: addresses: [192.168.0.160/24] gateway4: 192
2020-11-19 09:41:55
69
原创 MQTT
在开发中可能会有这样的情景。需要在容器启动的时候执行一些内容。比如读取配置文件,数据库连接之类的。SpringBoot给我们提供了两个接口来帮助我们实现这种需求。这两个接口分别为CommandLineRunner和ApplicationRunner。他们的执行时机为容器启动完成的时候。这两个接口中有一个run方法,我们只需要实现这个方法即可。这两个接口的不同之处在于:ApplicationRunner中run方法的参数为ApplicationArguments,而CommandLineRunner接口中r
2020-10-27 10:29:04
67
原创 springmvc influxdb setup
import org.influxdb.dto.QueryResult;import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;@Configurationpublic class InfluxDBConfigura.
2020-10-20 14:43:21
191
原创 virtual box centos8 network
connect: network is unreachablefix: dhclientdhclient命令的作用是:使用动态主机配置协议动态的配置网络接口的网络参数,也支持BOOTP协议。
2020-09-23 15:44:41
70
原创 POI excel
import java.awt.Color;import java.io.File;import java.io.FileInputStream;import java.io.FileNotFoundException;import java.io.FileOutputStream;import org.apache.poi.ss.usermodel.FillPatternType;import org.apache.poi.ss.usermodel.IndexedColors;import.
2020-09-11 12:38:02
73
原创 easyexcel
public class EmployeeRate extends BaseRowModel { @ExcelProperty(value = "表格头1",index = 0 ) private String aa; @ExcelProperty(value = "表格头2",index = 1 ) private String bb; } response.setContentType("multipart/form-data"); response.setCharact
2020-09-11 11:03:55
106
原创 easypoi 生成excel .
public static void main(String args[]) throws Exception { List<ExcelExportEntity> colList = new ArrayList<ExcelExportEntity>(); ExcelExportEntity colEntity = new ExcelExportEntity("商品名称", "title"); colEntity.setNeedMerg
2020-09-11 11:00:06
248
原创 springboot content type 处理
接收application/x-www-form-urlencoded类型的请求:@RequestParam Map<String, String> params接收application/json: @RequestBody (required = true) PageRequestParam pageRequestParam
2020-06-01 16:32:50
200
原创 Angular6 的服务和依赖注入
在开发中,组件一般用来写视图有关的功能,服务则写一些其他的逻辑,诸如从服务器获取数据、验证用户输入或直接往控制台中写日志等工作.Providers(提供商): provider通常就是自己写的服务类.Injector(注入器):就是字面上的意思,将某一类事物注入到另一类事物中的工具.angular应用在启动时,会自动创建.angular中有很多方式可以将providers注册到inject...
2019-11-19 17:02:09
323
转载 Git本地远程仓库的搭建(windows 7专业版)
Git本地远程仓库的搭建(windows 7专业版)你是否也这样想过?可以在自己的两台或者多台电脑中创建一个仓库,其他电脑的文件或者代码都可以push到这台机器中的git仓库进行版本管理,相当于有一个自己的git远程仓库。具体的功能可以这样理解:1.功能需求1)创建根仓库(总得仓库,比如本机D盘)里文件可见。2)本地仓库(C盘仓库)可关联根仓库(D盘仓库)并提交。3)局域网其他机器可访...
2019-11-12 11:15:53
357
原创 async/await的基础用法
async关键字1)表明程序里面可能有异步过程: async关键字表明程序里面可能有异步过程,里面可以有await关键字;当然全部是同步代码也没关系,但是这样async关键字就显得多余了;2)非阻塞: async函数里面如果有异步过程会等待,但是async函数本身会马上返回,不会阻塞当前线程,可以简单认为,async函数工作在主线程,同步执行,不会阻塞界面渲染,async函数内部由await关...
2019-11-08 15:40:34
233
原创 angular subscribe
ngAfterViewInit(): void { // Create simple observable that emits three values const myObservable = of(1, 2, 3); // Create observer object const myObserver = { ...
2019-11-08 15:14:08
414
原创 angular中动态创建组件
DynamicComponent.tsimport { Component, OnInit } from '@angular/core';@Component({ selector: 'app-dynamic', templateUrl: './dynamic.component.html', styleUrls: ['./dynamic.component.scss']})...
2019-11-08 13:02:20
112
原创 redis 1
redis :完全免费,遵守bsd协议, 高性能基于no-sql key-value数据库。C语言编写,支持网络,可基于内存也可以持久化 。NO-SQL:非关系型数据,数据与数据直接没有关系。1 key-value 存储数据:redis2 列存储数据库,HBase,Cassandra.3 文档型数据库 MongoDB 查询效率高4.图形数据库redis支持数据持久化,可存储在磁盘中。重...
2019-08-07 10:34:45
75
原创 log4j
public class Test{static Logger logger = LoggerFactory.getLogger(Test.class);public static void main(String[] args){BasicConfigurator.configure();LogManager.getRootLogger().addAppender(new Cons...
2019-04-19 16:09:56
70
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人