排序
使用google gson对json字符串和Java对象进行转换
使用google gson对json字符串和Java对象进行转换 java对象转换为json字符串 转换代码 /** * @author 四个空格-https://www.4spaces.org/ */ public class JavaToJsonDemo { public static void ...
Java中线程方法sleep()和wait()的区别
区别: sleep()是线程类(Thread)的方法,导致此线程暂停执行指定时间,把执行机会给其他线程,但是监控状态依然保持,超过指定时间后会自动恢复(线程回到就绪(ready)状态)。调用sleep()不...
MyEclipse出现BASE64Decoder提示错误的解决办法
在MyEclipse中编写Java代码实现将base64编码的字符串转换为图片格式时,用到了BASE64Decoder,import sun.misc.BASE64Decoder;可是MyEclipse提示: Access restriction : The type BASE64Decode...
The valid characters are defined in RFC 7230 and RFC 3986错误解决
通常请求地址包含未经编码的中文字符时会出现此错误提示: java.lang.IllegalArgumentException: Invalid character found in the request target. The valid characters are defined in RFC 72...
SpringBoot实现FTP文件下载及预览功能
SpringBoot将文件上传到FTP之后,后续的在前端进行文件的下载及预览实现方式如下: 前端代码 // 根据文件路径和文件名进行下载 function downLoadFile(filePath, fileName) { // 后台获取文件 v...
Java中Timer和ThreadPoolExecutor的区别和比较
今天闲来无事读Java中Timer的源码,发现Timer的注释中有这么一段 Java 5.0 introduced the {@code java.util.concurrent} package and one of the concurrency utilities therein is the {@link...
Java String日期格式化
SimpleDateFormat fromUser = new SimpleDateFormat('dd/MM/yyyy'); SimpleDateFormat myFormat = new SimpleDateFormat('yyyy-MM-dd'); try { String reformattedStr = myFormat.format(fromUs...
Struts2中doubleselect的使用方法
在Struts2的,<S:doubleselect>标签用于创建两个HTML下拉框,第一个下拉列表中选择后,第二个下拉列表将根据第一个选择发生相应的变化一个非常典型的例子是“国家”,“国家”下拉选项,不...
Spring Boot注解@PostConstruct含义
Spring Boot项目中使用@PostConstruct注解的作用是什么呢? 参考: 注解@PostConstruct与@PreDestroy详解及实例 @PostConstruct Why use @PostConstruct?
Java中如何遍历Map对象的4种方法
本文转载自:Java中如何遍历Map对象的4种方法! 在Java中如何遍历Map对象 How to Iterate Over a Map in Java 在java中遍历Map有不少的方法。我们看一下最常用的方法及其优缺点。 既然java中的所...