随笔分类 -  java日记

摘要:public class DemoApplication { private static ExecutorService pool; public static void main(String[] args) throws UnsupportedEncodingException, Interr 阅读全文
posted @ 2021-06-01 22:04 MartialWorldFish 阅读(225) 评论(0) 推荐(0)
摘要:ExecutorService executorService = Executors.newSingleThreadExecutor(); Future<String> future = executorService.submit(() -> myJob(param)); try { //设置超 阅读全文
posted @ 2021-06-01 21:58 MartialWorldFish 阅读(338) 评论(0) 推荐(0)
摘要:对于一些用户请求,在某些情况下是可能重复发送的,如果是查询类操作并无大碍,但其中有些是涉及写入操作的,一旦重复了,可能会导致很严重的后果,例如交易的接口如果重复请求可能会重复下单。 重复的场景有可能是: 黑客拦截了请求,重放 前端/客户端因为某些原因请求重复发送了,或者用户在很短的时间内重复点击了。 阅读全文
posted @ 2021-05-17 20:14 MartialWorldFish 阅读(866) 评论(0) 推荐(0)
摘要:ExecutorService executorService = Executors.newSingleThreadExecutor();Future<Boolean> future = executorService.submit(() -> method(param));try { //设置超 阅读全文
posted @ 2021-05-17 19:33 MartialWorldFish 阅读(562) 评论(0) 推荐(0)
摘要:1、下载JDK https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html 2、解压jdk并放到安装位置 进入到压缩包下的目录,解压到目录 tar -zxvf jdk-8u281-linux-x64.tar.g 阅读全文
posted @ 2021-03-27 01:40 MartialWorldFish 阅读(535) 评论(0) 推荐(0)
摘要:1:Intellij IDEA运行报Command line is too long解法 报错内容: Error running 'ServiceStarter': Command line is too long. Shorten command line for ServiceStarter o 阅读全文
posted @ 2020-04-26 20:09 MartialWorldFish 阅读(1644) 评论(0) 推荐(0)
摘要:在阮一峰大侠的ECMAScript 6 入门 了解到“尾递归”概念,一旦使用递归,就最好使用尾递归,再也不用担心"栈溢出"(stack overflow)。 public class BeanInfoDemo { public static void main(String[] args) { Fi 阅读全文
posted @ 2020-01-18 12:24 MartialWorldFish 阅读(207) 评论(0) 推荐(0)
摘要:URL:https://www.sina.com.cn/ 主机名:www.sina.com.cn 域名:sina.com.cn 买个域名可以搭建很多服务器:www、mail等等 URI: 阅读全文
posted @ 2019-11-21 18:27 MartialWorldFish 阅读(156) 评论(0) 推荐(0)
摘要:1 import java.net.*; 2 import java.io.*; 3 public class Server{ 4 public static void main(String args[]) throws Exception{ 5 ServerSocket server = new ServerSocket(9999); 6 while(true){ 7 Socket sock 阅读全文
posted @ 2019-11-21 18:14 MartialWorldFish 阅读(140) 评论(0) 推荐(0)