-
ReflectionToStringBuilder
所属栏目:[Java] 日期:2020-12-14 热度:73
1. 使用背景 后台接口需要在接口调用的初期,记录下面查询(修改)对象的参数。 2. 使用方法 通过Apache 工具类 输出entity对象所有属性值 org.apache.commons commons-lang3 使用:重写toString方法:ReflectionToStringBuilder.toString(this);[详细]
-
eclipse 使用jetty调试时,加依赖工程的源码调试方法
所属栏目:[Java] 日期:2020-12-14 热度:108
[1] 添加source eclipse-->debug as-->debug configurations-->source [2]若source不起作用 重新编译一下,mvn clean install即可[详细]
-
java set转list,数组与list的转换
所属栏目:[Java] 日期:2020-12-14 热度:99
读zookeeper的源码(zookeeper.java)时发现的,平时没有怎么注意: List/spanStringspan style="color: #000000;"gt; getDataWatches() { /spanspan style="color: #0000ff;"gt;synchronized/spanspan style="color: #000000;"gt;(watchManager.dataWatches)[详细]
-
netty检测系统工具PlatformDependent
所属栏目:[Java] 日期:2020-12-14 热度:93
1. 检测jdk版本 @SuppressWarnings("LoopStatementThatDoesntLoop" /spanspan style="color: #008000;"gt;///spanspan style="color: #008000;"gt; Not really a loop/span span style="color: #0000ff;"gt;for/spanspan style="color: #000000;"gt; (;;) {[详细]
-
Garbage Collection Optimization for High-Throughput and Low-
所属栏目:[Java] 日期:2020-12-14 热度:55
原文地址:https://engineering.linkedin.com/garbage-collection/garbage-collection-optimization-high-throughput-and-low-latency-java-applications High-performance applications form the backbone of the modern web. At LinkedIn,a number of inte[详细]
-
java poi 向excel写入图片
所属栏目:[Java] 日期:2020-12-14 热度:140
div class="cnblogs_code" span style="color: #0000ff;"import span style="color: #000000;" javax.imageio.ImageIO; span style="color: #0000ff;"import span style="color: #000000;" org.apache.poi.hssf.usermodel.HSSFClientAnchor; span style="col[详细]
-
Java exception handling best practices--转载
所属栏目:[Java] 日期:2020-12-14 热度:53
原文地址:http://howtodoinjava.com/2013/04/04/java-exception-handling-best-practices/ This post is another addition in??series available in this blog. In this post,I am covering some well-known and some little known practices which you mus[详细]
-
Writing Images to the Excel Sheet using PHPExcel--转载
所属栏目:[Java] 日期:2020-12-14 热度:94
原文地址:http://www.walkswithme.net/writing-images-to-the-excel-sheet-using-phpexcel Writing images to the excel sheet using phpexcel class is a great feature,using this method we can draw the images inside the excel column it looks good[详细]
-
编码与乱码(05)---GBK与UTF-8之间的转换--转载
所属栏目:[Java] 日期:2020-12-14 热度:56
原文地址:http://www.blogjava.net/pengpenglin/archive/2010/02/22/313669.html 【GBK转UTF-8】 在很多论坛、网上经常有网友问“?为什么我使用 new String(tmp.getBytes("ISO-8859-1"),"UTF-8") 或者 new String(tmp.getBytes("ISO-8859-1"),"GBK")可以得[详细]
-
java解压多目录Zip文件(解决中文乱码问题)--转载
所属栏目:[Java] 日期:2020-12-14 热度:120
原文地址:http://zhangyongbo.iteye.com/blog/1749439 /spanspan style="color: #0000ff;"gt;private/span span style="color: #0000ff;"gt;static/span span style="color: #0000ff;"gt;final/span span style="color: #0000ff;"gt;int/span buffer = 2048[详细]
-
WebSocket 实战--转
所属栏目:[Java] 日期:2020-12-14 热度:77
原文地址:http://www.ibm.com/developerworks/cn/java/j-lo-WebSocket/ 众所周知,Web 应用的交互过程通常是客户端通过浏览器发出一个请求,服务器端接收请求后进行处理并返回结果给客户端,客户端浏览器将信息呈现,这种机制对于信息变化不是特别频繁的应[详细]
-
Java – Reading a Large File Efficiently--转
所属栏目:[Java] 日期:2020-12-14 热度:107
原文地址:http://www.baeldung.com/java-read-lines-large-file 1. Overview This tutorial will show? how to read all the lines from a large file in Java ?in an efficient manner. This article is part of? Java – Back to Basic ” tutorial?here[详细]
-
java 文件读写--转载
所属栏目:[Java] 日期:2020-12-14 热度:103
读文件 http://www.baeldung.com/java-read-file 1. Overview In this tutorial we’ll explore different ways to? read from a File in Java ; we’ll make use of BufferedReader ,? Scanner ,? StreamTokenizer ,? DataInputStream ,? SequenceInputStre[详细]
-
8 Great Java 8 Features No One's Talking about--转载
所属栏目:[Java] 日期:2020-12-14 热度:150
原文地址:http://www.infoq.com/articles/Java-8-Quiet-Features If you haven’t seen some of the videos or tutorials around Java 8,you’ve probably been super-busy or have a more interesting social life than I do (which isn’t saying much).[详细]
-
Five ways to maximize Java NIO and NIO.2--转
所属栏目:[Java] 日期:2020-12-14 热度:177
原文地址:http://www.javaworld.com/article/2078654/java-se/java-se-five-ways-to-maximize-java-nio-and-nio-2.html Java NIO -- the New Input/Output API package-- was introduced with J2SE 1.4 in 2002. Java NIO's purpose was to improve the pro[详细]
-
Catch Me If You ... Can't Do Otherwise--转载
所属栏目:[Java] 日期:2020-12-14 热度:112
原文地址:https://dzone.com/articles/catch-me-if-you-cant-do-otherwise I don't know whether it's an anti-pattern or just a common and very popular mistake,but I see it everywhere and simply must write about it. I'm talking about? exception[详细]
-
简约之美jodd--props属性使用
所属栏目:[Java] 日期:2020-12-14 热度:156
Prop是一个超级properties;包含了很多jdk缺失的东西:utf-8支持,宏,分区,profiles,全配置等等。 属性存储在一个或者多个*.props文件,而且它是开放的,支持多种类型的资源。更重要的是,它和java properties是兼容的。 Props的目标不是提供一个最大限度[详细]
-
jodd-cache集锦
所属栏目:[Java] 日期:2020-12-14 热度:173
Jodd cache提供了一组cache的实现,其层次如下: 其中, AbstractCacheMap是一个具有计时和大小的缓存map的默认实现,它的实现类必须: 创建一个新的缓存map。 实现自己的删除(prune)策略。 内部使用ReentranReadWriteLock来同步。因为从一个读锁升级到一个[详细]
-
the resource is not on the build path of a java project错误
所属栏目:[Java] 日期:2020-12-14 热度:99
在eclipse中,使用maven 解决方法: ?1. 找到buildpath下面的src下的文件remove掉,然后重新加上去,此时会更新所有目录。 ? 2. 关闭该类,重新打开即可[详细]
-
java根据url获取完整域名
所属栏目:[Java] 日期:2020-12-14 热度:102
div class="cnblogs_code" /spanspan style="color: #0000ff;"gt;if/span(destination==span style="color: #0000ff;"gt;null/span||destination.trim().equals(""span style="color: #000000;"gt;)){ /spanspan style="color: #0000ff;"gt;return/span ""sp[详细]
-
简约之美Jodd-http--应用一箩筐
所属栏目:[Java] 日期:2020-12-14 热度:108
Jodd-http是一个微型的、简约的http client,然而简单而且方便。使用它可以轻松的实现发送请求和读取响应。它的目标就是日常应用变的非常简单,从而简化开发人员的工作。 了解Jodd-http的最好方法就是示例程序。 简单的GET方法 HttpRequest httpRequest = Ht[详细]
-
jodd-StringTemplateParser使用
所属栏目:[Java] 日期:2020-12-14 热度:106
StringTemplateParser ?时一个string模板的解析器。在string模板中定义类似jsp标签的宏。 在解析过程中,宏被对值替换,值通过自定义的MacroResolver解析得到。 简单示例如下: String template = "Hello ${foo}. Today is ${dayName}." /spanspan style="co[详细]
-
java poi操作excel示例代码
所属栏目:[Java] 日期:2020-12-14 热度:114
div class="cnblogs_code" span style="color: #0000ff;"import span style="color: #000000;" org.apache.poi.hssf.usermodel.HSSFCell; span style="color: #0000ff;"import span style="color: #000000;" org.apache.poi.hssf.usermodel.HSSFRow; span st[详细]
-
简约之美Jodd-http--深入源码理解http协议
所属栏目:[Java] 日期:2020-12-14 热度:141
Jodd 是一个开源的 Java 工具集, 包含一些实用的工具类和小型框架。简单,却很强大! jodd-http是一个轻巧的HTTP客户端。现在我们以一个简单的示例从源码层看看是如何实现的? HttpRequest httpRequest = HttpRequest.get("http://jodd.org" = System.out.p[详细]
-
servlet 和filter 抛出404等异常
所属栏目:[Java] 日期:2020-12-14 热度:112
1. servlet抛出错误代码异常,如404 2. filter抛出错误代码异常 = = httpResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED);}[详细]