JAVA
文章平均质量分 71
jack0511
这个作者很懒,什么都没留下…
展开
-
PMD规则之Optimization Rules
PMD规则之Optimization Rules翻译 2010-10-27 10:54:00 · 3139 阅读 · 0 评论 -
PMD规则之Migration Rules
PMD规则之Migration Rules翻译 2010-10-26 09:57:00 · 2155 阅读 · 0 评论 -
PMD规则之Java Logging Rules
PMD规则之Java Logging Rules翻译 2010-07-09 15:13:00 · 4971 阅读 · 0 评论 -
PMD规则之Jakarta Commons Logging Rules
PMD规则之Jakarta Commons Logging Rules翻译 2010-07-09 15:11:00 · 2010 阅读 · 0 评论 -
PMD规则之Junit Rules
PMD规则之Junit Rules翻译 2010-07-09 15:07:00 · 2532 阅读 · 0 评论 -
PMD规则之J2EE Rules
· UseProperClassLoader: In J2EE getClassLoader() might not work as expected. Use Thread.currentThread().getContextClassLoader() instead. 翻译 使用合适的类加载器:在J2EE中getClassLoader()方法可能不会按照期望工作。使用Thread.cu翻译 2010-03-04 08:58:00 · 2901 阅读 · 0 评论 -
PMD规则之Import Statement Rules
· DuplicateImports: Avoid duplicate import statements. 翻译 重复的引入:避免重复的import· DontImportJavaLang: Avoid importing anything from the package java.lang. These classes are automatically imported翻译 2010-03-04 08:57:00 · 3656 阅读 · 0 评论 -
PMD规则之Code Size Rules
· NPathComplexity: The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken t翻译 2010-03-04 08:50:00 · 8965 阅读 · 0 评论 -
PMD规则之Braces Rules
· IfStmtsMustUseBraces: Avoid using if statements without using curly braces. 翻译 if块必须用括号:避免使用if块时不使用花括号{}· WhileLoopsMustUseBraces: Avoid using while statements without using curly braces.翻译 2010-03-04 08:48:00 · 3847 阅读 · 0 评论 -
PMD规则之Clone Implementation Rules
· ProperCloneImplementation: Object clone() should be implemented with super.clone(). 翻译 适当的克隆实现:对象的clone()方法中应该包含super.clone()实现· CloneThrowsCloneNotSupportedException: The method clone() shou翻译 2010-03-04 08:50:00 · 2957 阅读 · 0 评论 -
PMD规则之Type Resolution Rules
PMD规则之Type Resolution Rules翻译 2010-10-27 10:59:00 · 2443 阅读 · 0 评论 -
PMD规则之Naming Rules
PMD规则之Naming Rules翻译 2010-10-26 10:00:00 · 7987 阅读 · 0 评论 -
POI读取Excel(兼容Excel2003、Excel2007)
Excel数据读取工具类,POI实现读取Excel2003,Excel2007原创 2011-02-11 18:44:00 · 35218 阅读 · 6 评论 -
使用二分法Arrays.binarySearch()与list.contains()进行元素比较的效率分析
使用二分法Arrays.binarySearch()与list.contains()进行元素比较的效率分析原创 2011-02-28 16:35:00 · 5528 阅读 · 0 评论 -
快速排序JAVA实现
JAVA实现快速排序原创 2010-11-04 17:25:00 · 866 阅读 · 0 评论 -
JqGrid小试
jquery的一个Grid插件JqGrid研究学习原创 2010-12-21 19:37:00 · 2670 阅读 · 0 评论 -
PMD规则之Unused Code Rules
PMD规则之Unused Code Rules翻译 2010-10-27 11:00:00 · 3224 阅读 · 0 评论 -
PMD规则之Security Code Guidelines
PMD规则之Security Code Guidelines翻译 2010-10-27 10:58:00 · 3119 阅读 · 0 评论 -
PMD规则之String and StringBuffer Rules
PMD规则之String and StringBuffer Rules翻译 2010-10-27 10:57:00 · 10324 阅读 · 1 评论 -
PMD规则之Strict Exception Rules
PMD规则之Strict Exception Rules翻译 2010-10-27 10:56:00 · 8210 阅读 · 0 评论 -
PMD规则之JavaBean Rules
· BeanMembersShouldSerialize: If a class is a bean, or is referenced by a bean directly or indirectly it needs to be serializable. Member variables need to be marked as transient, static, or have acc翻译 2010-03-04 08:59:00 · 2706 阅读 · 0 评论 -
PMD规则之Finalizer Rules
· EmptyFinalizer: If the finalize() method is empty, then it does not need to exist. 翻译 空的finalize():如果finalize()方法是空的,那么它就不需要存在。· FinalizeOnlyCallsSuperFinalize: If the finalize() is implement翻译 2010-03-04 08:56:00 · 1870 阅读 · 0 评论 -
PMD规则之Design Rules
· UseSingleton: If you have a class that has nothing but static methods, consider making it a Singleton. Note that this doesnt apply to abstract classes, since their subclasses may well include non-翻译 2010-03-04 08:54:00 · 19184 阅读 · 1 评论 -
Struts与Spring集成方式
struts1.x版本和spring的集成与struts2.0和spring的集成存在较大的差异 struts1.x与spring集成方式 方式一:Action交给spring管理,将业务类注入action 引入spring-webmvc-struts.jar包到lib下, struts配置:原创 2009-09-21 11:16:00 · 844 阅读 · 0 评论 -
Java与模式(阎宏著)之原型模式读书笔记
什么是原型模式? 原始模型模式属于对象的创建模式[GOF95]。通过给出一个原型对象来指明所要创建的对象的类型,然后用复制这个原型对象的办法创建出更多同类型的对象。这就是原始模型模式的用意。 什么情况下使用原型模式? 如果一个系统的产品类是动态加载的,而且产品类具有一定的等级结构。这个时候如果采用工厂模式,工厂类就不得不具有一个相应的等级结构。而产品的类原创 2008-12-22 14:07:00 · 1909 阅读 · 1 评论 -
单例模式,多例模式及其应用
单例模式: 当整个应用只允许出现一个类实例时,我们经常用到单例模式。比如工具类,国际化服务提供类等等 单例模式分为两种,一种饿汉式:在类加载的时候即完成对象创建,保证始终只有一个对象存在 Class Singleton{ private static Singleton s = new Singleton (); private Singleton(){原创 2009-02-04 15:40:00 · 6726 阅读 · 0 评论 -
在Linux下Java环境的部署(linux+jdk+tomcat+mysql)
1 系统安装略..2 环境配置l JDK1.5安装1 取得JDK 安装包,本示例采用JDK 1.5.0.04For Linux安装版2 将jdk-1_5_0_04-linux-i586.bin更改为可执行属性 chmod +x jdk-1_5_0_04-linux-i586.bin3原创 2008-06-29 19:57:00 · 2233 阅读 · 1 评论 -
struts1.1中禁止页面缓存配置方法
在struts-config.xml中做如下配置 debug="3" locale="true" nocache="true"//设为false则允许原创 2008-09-02 15:02:00 · 1703 阅读 · 0 评论 -
JAVA代码优化
通过使用一些辅助性工具来找到程序中的瓶颈,然后就可以对瓶颈部分的代码进行优化。一般有两种方案:即优化代码或更改设计方法。我们一般会选择后者,因为不去调用以下代码要比调用一些优化的代码更能提高程序的性能。而一个设计良好的程序能够精简代码,从而提高性能。下面将提供一些在JAVA程序的设计和编码中,为了能够提高JAVA程序的性能,而经常采用的一些方法和技巧。1.对象的生成和大小的调整。JAVA程转载 2008-08-30 16:30:00 · 1858 阅读 · 2 评论 -
JSP优化
以下内容为网络转帖及读书笔记整合 一.标识(注释)的优化 网站在开发上往往容易出现这样两种情况:一种是代码过于紧密,其中包含大量注释信息和排版空白,一种就是代码太过宽松,其中不但包含了编辑器自动生成的标识语言及大量缩排空白,而且包含了编辑器常用来控制文件结构的特定注释,甚至还有冗余或无用的标识或代码。象这样的代码是不适合传输的。我们可以通过下面一些安全有效的途径来减小文件的大小:转载 2008-08-30 16:24:00 · 3437 阅读 · 0 评论 -
java处理汉诺塔问题
import java.util.Scanner;public class HanoiTest { public HanoiTest(){ } public static void move(String from,String to){ System.out.println("move the top plate from "+from+" to "+to); } p原创 2008-05-09 15:26:00 · 733 阅读 · 0 评论 -
struts2.0关于请求jsp方式上传的问题
最近在项目中用到了struts2.0,并在页面中嵌入了一个Kindeditor的编辑器,Kindeditor的插入图片功能先通过一个jsp将图片上传到服务器,然后获取图片的url进行显示,然而编码时图片总是无法上传到服务器,代码如下,经调试发现fileItems总是为空%@page contentType="text/html; charset=UTF-8"%>try{//文件保存目录路径Se原创 2008-04-14 18:15:00 · 1500 阅读 · 4 评论 -
图片预装载弱化图片一张一张刷出的效果
预加载是一项在需要图像之前就把它下载到缓冲区里的技术。通过这种方式,当真的需要图像的时候,它可以被从缓冲区里取出来,并立即显示出来。但是需要第一次调用图像的时候仍然会产生延迟,所以第一次只能弱化这种延迟的效果。::: P function preloader() { imageobj = new Image(); // set image list原创 2008-04-15 15:04:00 · 917 阅读 · 0 评论 -
PMD规则之Coupling Rules
· CouplingBetweenObjects: This rule counts unique attributes, local variables and return types within an object. A number higher than specified threshold can indicate a high degree of coupling. 翻译翻译 2010-03-04 08:53:00 · 3785 阅读 · 0 评论 -
PMD规则之Controversial Rules
· UnnecessaryConstructor: This rule detects when a constructor is not necessary; i.e., when theres only one constructor, its public, has an empty body, and takes no arguments. 翻译 非必要的构造器:本规则检查不必翻译 2010-03-04 08:52:00 · 12127 阅读 · 0 评论 -
PMD规则之Basic Rules
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 <! /* Style翻译 2010-03-03 16:35:00 · 9407 阅读 · 1 评论 -
效率较高的冒泡排序
package com.ds;import java.util.Arrays;public class BubbleSort { public int[] sort(int[] source){ int[] dest=new int[source.length]; System.arraycopy(source, 0, dest, 0, source.length原创 2010-03-02 10:30:00 · 1263 阅读 · 1 评论 -
JConsole连接Tomcat使用注意点
1.启动JConsole和启动应用程序的操作系统用户必须一致,Window下可以进入任务管理器查看进程的用户名 2.改动Tomcat 6.0/bin/catalina.bat(Tomcat zip版) 加入以下内容:set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote-Dcom.sun.management原创 2009-12-23 09:35:00 · 5431 阅读 · 0 评论 -
Java代码检测工具PMD规则集翻译合集
<p class="MsoNormal" style="margin: 0cm 0cm 0pt;"><span style="font-family: 宋体; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman;">以下内容为 PMD <span style="font-f翻译 2010-01-27 11:09:00 · 8530 阅读 · 2 评论 -
Webservice(基于Axis2-1.4.1)复杂数据类型解决方案
一.用CXF进行服务端发布,Axis2 XMLBean方式生成客户端,这种方式安全不太好处理 二.将所有的复杂类型转换为自定义对象和对象数组,如原本返回List 修改为返回Person[]Map转换为MyObject[] ,包含两个字符串类型属性的自定义类型(MyObject)的数组,然后用XMLBean方式生成客户端 这个是我在项目中使用的方案 三.使用AXI原创 2009-11-27 10:53:00 · 3828 阅读 · 0 评论