This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 获取对象属性值,支持嵌套属性(like el表达式) | |
* @param obj | |
* @param property p1.p2 | |
* @return | |
*/ | |
public static Object getProperty(Object obj, String property) { | |
if (obj == null || StringUtil.isBlank(property)) | |
return null; | |
String[] propertyArray = property.split("\\."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//得到整个页面,用于列表页面读取 | |
function getPage(url,param,div){ | |
//对中文进行编码 | |
param = encodeURI(param); | |
document.getElementById(div).innerHTML = "<div style=\"text-align:center; line-height:30px; padding-top:50px;\"><img src=\"/2011/images/down/loading.gif\" width=\"66\" height=\"66\" /><br />数据正在加载中,请稍等……</div>"; | |
jQuery.ajax({ | |
type:"GET", | |
url:url+"?div="+div+param, | |
async: true, | |
dataType: "html", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<link href="../css/style.css" type="text/css" rel="stylesheet" /> | |
<script src="../css/jquery.js" type="text/javascript"></script> | |
<script src="../css/jquery.cookie.js" type="text/javascript"></script> | |
<script src="../css/jquery.treeview.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$(function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Classname : MD5Util | |
* Create Date : Aug 15, 2006 | |
*/ | |
import java.security.MessageDigest; | |
/** | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.iteye.common.test; | |
import junit.framework.TestCase; | |
import org.hibernate.FlushMode; | |
import org.hibernate.Session; | |
import org.hibernate.SessionFactory; | |
import org.springframework.context.ApplicationContext; | |
import org.springframework.context.support.ClassPathXmlApplicationContext; | |
import org.springframework.orm.hibernate3.SessionFactoryUtils; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jvm内存模型 | |
---JMM就是java解决多线程下内存共享的一个模型,与内存分区管理是不同的层面! | |
根据线程私有和线程共享来看: | |
线程私有: | |
---程序计数器:如果正在执行Java方法,则指向虚拟机字节码指令的地址,如果是native的,这个计算器的值为空。 | |
---虚拟机栈:保存本地变量、操作数栈、动态链接、方法出口等信息。为执行java方法服务。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum SingletonEnum { | |
/** | |
* 定义一个枚举的元素,它就代表了Singleton的一个实例。 | |
*/ | |
uniqueInstance; | |
/** | |
* 单例可以有自己的操作 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SingleInstance { | |
private static class InstanceHolder { | |
public static final SingleInstance instance = new SingleInstance(); | |
} | |
public static SingleInstance getInstance() { | |
return InstanceHolder.instance; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void doCopyFile(File srcFile, File destFile, boolean preserveFileDate) throws IOException { | |
if (destFile.exists() && destFile.isDirectory()) { | |
throw new IOException("Destination '" + destFile + "' exists but is a directory"); | |
} | |
FileInputStream fis = null; | |
FileOutputStream fos = null; | |
FileChannel input = null; | |
FileChannel output = null; | |
try { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package test; | |
import java.util.Scanner; | |
public class ScissorStoneCloth { | |
/** | |
* @param args | |
*/ | |
public static void main(String[] args) { |