摘要: 我们查看下ObjectOutputStream的writeObject方法 //final方法,不允许子类覆盖 public final void writeObject(Object obj) throws IOException { if (enableOverride) { //如果开启允许序列化被重写 writeObjectOverride(obj); //调用子类的序列化重写方法 return; } try { writeObject0(obj, fals... 阅读全文
posted @ 2012-06-02 08:49 zhwj184 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Socket:一台机器的通讯节点称为socket,在java中,socket是java.net包里面的Socket,ServerSocket,DataGramSocket,MultiSocket的实例。IP地址java中用java.net.InetAddress来表示。java network address class包括:InetAddress:ip地址或者域名,指向远程地址。如果域名解析不了,则出错。 抽象类,有两个子类:Inet4Address和Inet6Address。这两个类智能通过InetAddress的静态方法获取,不能直接构造。包可见。InetSocketAddres... 阅读全文
posted @ 2012-06-02 08:46 zhwj184 阅读(683) 评论(0) 推荐(0) 编辑
摘要: encache的web cache代码分析1.抽象filter分析 public abstract class Filter implements javax.servlet.Filter { ...... public final void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws ServletException, IOException { final HttpServletR... 阅读全文
posted @ 2012-06-02 08:45 zhwj184 阅读(272) 评论(0) 推荐(0) 编辑
摘要: web caching1.介绍Ehcache Web 是EhCache缓存框架的一个组件,主要用于Java开发Web项目中的一些缓存功能。包括一个单页缓存过滤器:SimplePageCachingFilter;页面压缩(gzip)支持;页面片段缓存等功能。在某些情况下能够很好的提高web应用的性能。2.simplePageCachingFilter 能够缓存httpresponse的html,json,xml等输出的完整页面或者页面片段的缓存,也支持gzipping的页面缓存。页面片段缓存可以参考SimplePageFragmentCachingFilter类。3.keys缓存的key值 缓存 阅读全文
posted @ 2012-06-02 08:42 zhwj184 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1.pom依赖 <dependency> <groupId>org.tmatesoft.svnkit</groupId> <artifactId>svnkit</artifactId> <version>1.3.5</version> </dependency>2.java调用代码import org.tmatesoft.svn.core.SVNDepth; import org.tmatesoft.svn.core.SVNException; import org.tmatesoft.svn.co 阅读全文
posted @ 2012-06-02 08:41 zhwj184 阅读(522) 评论(0) 推荐(0) 编辑
摘要: 1.redhat下用yum安装 yum install samba system-config-samba samba-client samba-common2.修改samba下的配置文件 修改/etc/samba/smb.conf 2.1 把security = user改为security = share,默认是需要用户名密码访问,改为share之后就可以不用用户名密码就能直接访问 2.2添加共享访问目录 [share] comment = Public Stuff path = /home/samba browseable = yes public = yes... 阅读全文
posted @ 2012-06-02 08:39 zhwj184 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 下面讲解如何使用spring-data-mongdb来对mongdb进行增删改查的操作你需要的工具:Spring Data MongoDB – 1.0.0.M2Spring Core – 3.0.5.RELEASEJava Mongo Driver – 2.5.2Eclipse – 3.6JDK – 1.6Maven – 3.0.31.工程目录结构 2.依赖 你需要在pom.xml里面添加如下依赖 <repositories> <repository> <id>spring-milestone</id> <name>Spring Ma 阅读全文
posted @ 2012-06-02 08:39 zhwj184 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1.spring-data-redis如何连接到redis服务端 其中定义了两个接口org.springframework.data.redis.connection下的RedisConnection和RedisConnectionFactory工厂接口: public interface RedisConnection extends RedisCommands { void close() throws DataAccessException; boolean isClosed(); Object getNativeConnection(); boolean isQ... 阅读全文
posted @ 2012-06-02 08:36 zhwj184 阅读(438) 评论(0) 推荐(0) 编辑
摘要: 使用了spring-data-redis对于redis的orm框架的学习,整理了一下的使用文档1.在pom.xml添加一下依赖: <dependencies> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-redis</artifactId> <version>1.0.0.RC1</version> </dependency> </dependencies> & 阅读全文
posted @ 2012-06-02 08:32 zhwj184 阅读(257) 评论(0) 推荐(0) 编辑
摘要: NDC(Nested Diagnostic Context)和MDC(Mapped Diagnostic Context)是log4j种非常有用的两个类,它们用于存储应用程序的上下文信息(context infomation),从而便于在log中使用这些上下文信息。NDC的实现是用hashtable来存储每个线程的stack信息,这个stack是每个线程可以设置当前线程的request的相关信息,然后当前线程在处理过程中只要在log4j配置打印出%x的信息,那么当前线程的整个stack信息就会在log4j打印日志的时候也会都打印出来,这样可以很好的跟踪当前request的用户行为功能。MDC的 阅读全文
posted @ 2012-06-02 08:30 zhwj184 阅读(186) 评论(0) 推荐(0) 编辑
摘要: oracle里面要获取每个分组里面的topN可以采用:select * from (select emp_id, name, occupation, rank() over ( partition by occupation order by emp_id) rank from employee) where rank <= 3 select * from (select emp_id, name, occupation,rank() over ( partition by occupation order by emp_id,RowNum) ... 阅读全文
posted @ 2012-06-02 08:28 zhwj184 阅读(178) 评论(0) 推荐(0) 编辑
摘要: velocity本身支持自定义标签和指令的扩展,在 Velocity 模板语言的语法中,以美元符 $ 开头的为变量的声明或者引用,而以井号 # 开头的语句则为 Velocity 的指令(Directive)。velocity支持的指令有:#set,#foreach,#if #else #end,#parse,#include,#evaluate,#define,#macro,在velocity的jar包中的directive.properties中定义了这些实现:directive.1=org.apache.velocity.runtime.directive.Foreach directiv 阅读全文
posted @ 2012-06-02 08:27 zhwj184 阅读(669) 评论(0) 推荐(0) 编辑
摘要: 需要引入 <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-core</artifactId> <version>3.6.0</version> </dependency> <dependency> <groupId>org.apache.lucene</groupId> <artifactId>lucene-highlighter</artifactId&g 阅读全文
posted @ 2012-06-02 08:25 zhwj184 阅读(185) 评论(0) 推荐(0) 编辑
摘要: "a:" /* access mask for unix socket */ "p:" /* TCP port number to listen on */ "s:" /* unix socket path to listen on */ "U:" /* UDP port number to listen on */ "m:" /* max memory to use for items in megabytes */ "M" /* return error o... 阅读全文
posted @ 2012-06-02 08:25 zhwj184 阅读(211) 评论(0) 推荐(0) 编辑