`
文章列表

线程池

    博客分类:
  • java
public void dorun(){ //构造一个线程池 ThreadPoolExecutor threadPool = new ThreadPoolExecutor(5, 10, 3, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10),             new ThreadPoolExecutor.CallerRunsPolicy()); for (int i = 1; i <= sheet.getLastRowNum(); i++) {              threadPoo ...
跟我学Spring3 学习笔记一 跟我学Spring3 学习笔记二 跟我学Spring3 学习笔记三 跟我学Spring3 学习笔记四     常量注入:   <!-- 常量注入 --> <bean id="AfxMessage" class="java.lang.String"> <constructor-arg index="0" value="Hello Spring by id" /> </bean> <bean id=& ...
@echo off set .=%random% set "d=%.%%.%" set d=%d:~-5% echo %d%>>b.txt    
  /** * setter注入 添加set get 方法 */ public class HelloImplConstr implements HelloApi { private String message; private int index; // 空的构造器一定要有 public HelloImplConstr(){ } @ConstructorProperties({"message","index"}) public HelloImplConstr(String m ...
     构造器注入法: /** * 构造器注入可以根据参数索引注入、参数类型注入或Spring3支持的参数名注入, * 但参数名注入是有限制的,需要使用在编译程序时打开调试模式 * (即在编译时使用“javac –g:vars”在class文件中 ...
//静态工厂方法 public class HelloApiStaticFactory { public static HelloApi newInstance(String msg){ //返回需要的Bean实例 return new HelloImpl(msg); } }   <!-- 静态工厂方法 --> <bean id="helloFactory" class="com.HelloApiStaticFactory" factory-method="newInstance" ...
  public interface HelloApi { public void sayHello(); }     public class HelloImpl implements HelloApi{ public void sayHello() { System.out.println("Hello World ! "); } }     <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="ht ...

自定义标签

    博客分类:
  • java
public class ParseViewIPTag extends TagSupport{ @Override public int doStartTag() throws JspException { HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest(); JspWriter out = this.pageContext.getOut(); String ip = request.getRemoteAddr(); try { ...

oscache 缓存

    博客分类:
  • java
  数据库查询结果缓存 //缓存对象 private static GeneralCacheAdministrator admin = new GeneralCacheAdministrator(); /* 刷新缓存的间隔,单位为秒,此处设置为 10 秒 */ int myRefreshPeriod = 10; //标识是否更新缓存 boolean update = false; try { /* 从 Map 中取出键值为 key 的对象,返回一个Object 对象,需要强制转换 */ list = (List<Users>) admin.getFromCa ...
public class HibernateSessionFactory { /** * Location of hibernate.cfg.xml file. * Location should be on the classpath as Hibernate uses * #resourceAsStream style lookup for its configuration file. * The default classpath location of the hibernate config file is ...

http 发送报文

<span><p> <HEADER> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> </HEADER> <span><p> 请求服务<FORM method="post" action="http://10.106.22.241:8089/service/dovider.action"> <TEXTAREA ...
<opml version="1.0"><head><title>Maxthon Reader Export Data</title></head><body><outline type="rss" text="http://blog.csdn.net/rss.html?type=Home&amp;channel=" title="http://blog.csdn.net/rss.html?type=Home&amp;channel= ...
public class OperSysProperty { //属性文件的路径 static String profilepath="syscfg.properties"; static String Object = "object"; private static Properties props = new Properties(); private static Properties proNum = new Properties(); static { try { ...
// 处理钩子的对象 var hook = (function () { return { timer:null, init:function () { this.callHooks('init'); }, callHooks:function (init) { var s = "hook_" + init + '_event', ...
<link rel="stylesheet" type="text/css" href="ext-2.2/resources/css/ext-all.css" /> <script type="text/javascript" src="ext-2.2/adapter/ext/ext-base.js"></script> <script type="text/javascript" src="ext ...
Global site tag (gtag.js) - Google Analytics