`
sbl2255
  • 浏览: 224680 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论
文章列表
1.使用命名空间 jQuery.myPlugin = { order:function(){ alert("Click Order"); }, exit:function(param){ alert("param:"+param); } } 自定义一个myPlugin命名空间 调用: $.myPlugin.order(); $.myPlugin.exit('admin'); 2.在jQuery下的命名空间创建方法 $.fn.orders = function(){ alert("order fu ...
Spring MVC (MVC这里就不再浪费口舌了,有空可以上百度看看) 主要分享下对SpringMVC的理解. Spring MVC主要核心是围绕DispatcherServlet, 1.首先在Web.xml中定义Servlet,并优先启动 <servlet> <servlet-name>mvc</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-o ...

JDK之IP

    博客分类:
  • jdk
try { Enumeration<NetworkInterface> ips = NetworkInterface.getNetworkInterfaces(); InetAddress local = InetAddress.getByName("PC-201001191418"); while(ips.hasMoreElements()){ NetworkInterface ip = ips.nextElement(); Enumeration<InetAddress> ipaddr ...

JDK多任务处理

    博客分类:
  • jdk
接口ExecutorService 继承 Executor接口,而Executor 是一个多任务的一个调度器,Executor 不会显示的创建线程。 注意,最后必须调用shutdown,否则线程任务将一直运行状态 public class Task implements Callable<String> { @Override public String call() throws Exception { // TODO Auto-generated method stub System.out.println("Do something~&q ...
在线程开发中,常常会遇到资源共享与同步的问题,synchronized就是来解决这个问题的,可是当谈到Thread通信,它就不能全部胜任了,还需要notify、wait等来配合。 public class Demo { private String msg = ""; private boolean isend = false; public String getMsg() { return msg; } public synchronized void setMsg(String msg) { isend = fals ...
如图: 代码: ByteArrayOutputStream jpgout = new ByteArrayOutputStream(); String id = req.getSession().getId(); BufferedImage bimg = new DefaultManageableImageCaptchaService().getImageChallengeForID(id,req.getLocale()); JPEGImageEncoder imgcode = JPEGCodec.createJPEGEncoder(jpgout); imgcod ...

JDK 之 Annotation

    博客分类:
  • jdk
通过学习,发现Annotation真是个好东西,于是就自己写了个简单的例子; 第一步: 先定义一个@interface: package com.org.jdk; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @Retention(RetentionPolicy.RUNTIME) @Target(El ...
打印web页面,调用window.print(),可是还有一个问题,这样一来它把页面上的所有东西全部打印出来了。 在页面加入: <style> @media print { .noprint {display:none} .PageNext{page-break-after: always;} } </style> 样式表中做如下定义: @media print { .noprint {display:none} } 使用div划定非打印区域 <div align="center" class="no ...
public static void main(String[] args) { // TODO Auto-generated method stub String path = "c:\\a.zip"; try { ZipFile z = new ZipFile(new File(path)); System.out.println("path : " +z.getName() + " files : " + z.size()); Enumeration files = z.entries ...

JDK的那点东西

    博客分类:
  • jdk
    需要总结的东西 1. jps java 中的一个 ps 命令, 查看当前PID(进程信息) 2.jconsole java 对vm 监视的一个GUI 工具 3.keytool 一个安全证书的工具... 4.jdb 一个class的调试工具
   一个Mysql集群代理,性能上的优化。 详细教程: http://blog.csdn.net/heiyeshuwu/archive/2008/01/28/2069190.aspx
Spring 解析Property : org.springframework.beans.factory.config.PropertyPlaceholderConfigurer 在applicationcontext.xml中配置需要的bean <bean id="propertyutil" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations" ...
引用 //复制代码 function doCopy(id){ var testCode=document.getElementById(id).innerText; if(copy2Clipboard(testCode)!=false){ if (document.all){ var rng = document.body.createTextRange(); rng.moveToElementText(document.getElementById(id)); rng.scrollIntoView(); rng.select(); rng.collapse(false); } ...
1. 判断对象是否为空. public static boolean empty(Object obj) { if (obj == null) return true; if ((obj instanceof String) && (((obj.equals("")) || (obj.equals("0"))))) return true; if ((obj instanceof Number) && (((Number)obj).doubleValue() ...
public static void main(String[] args) { // TODO Auto-generated method stub Document bf; try { bf = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File("c:\\web.xml")); NodeList nodelist = bf.getElementsByTagName("filter"); for(int a=0;a ...
Global site tag (gtag.js) - Google Analytics