上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 70 下一页
摘要: 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 MXi4oyu 阅读(271) 评论(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 MXi4oyu 阅读(265) 评论(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 MXi4oyu 阅读(536) 评论(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 MXi4oyu 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 其中fixup和fixdown就是堆排序的使用。 /** * This class represents a timer task queue: a priority queue of TimerTasks, * ordered on nextExecutionTime. Each Timer object has one of these, which it * shares with its TimerThread. Internally this class uses a heap, which * offers log(n) performance for the add,... 阅读全文
posted @ 2012-05-31 13:54 MXi4oyu 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 这个异常经过在jetty的一个简单程序的测试验证,确定问题及分析如下:这个程序在使用response输出结果时,先调用response的getWriter获得PrintWrite对象后输出内容,然后再调用getOutputStream方法获得outputStream对象后输出二进制内容,然后就跑出上面那个异常了。 这两个方法在jetty容易中是这么处理: org.eclipse.jetty.server.Response继承自j2ee里面的HttpServletResponse.java类 org.eclipse.jetty.server.Response.java类里面 publ... 阅读全文
posted @ 2012-05-31 13:51 MXi4oyu 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 最近有个需求需要对于获取URL页面进行host绑定并且立即生效,在java里面实现可以用代理服务器来实现:因为在测试环境下可能需要通过绑定来访问测试环境的应用 实现代码如下: public static String getResponseText(String queryUrl,String host,String ip) { //queryUrl,完整的url,host和ip需要绑定的host和ip InputStream is = null; BufferedReader br = null; StringBuffer res = n... 阅读全文
posted @ 2012-05-31 13:49 MXi4oyu 阅读(564) 评论(0) 推荐(0) 编辑
摘要: jetty启动分析 jetty启动命令:java -jar /usr/alibaba/jetty/start.jar -Djetty.home=/usr/alibaba/jetty --ini=/home/admin/deploy/jetty/start.ini 如果加上--help参数,则显示jetty启动的参数设置和配置设置,如下: #java -jar /usr/alibaba/jetty/start.jar -Djetty.home=/usr/alibaba/jetty --ini=/home/admin/deploy/jetty/start.ini --help propertie. 阅读全文
posted @ 2012-05-31 13:45 MXi4oyu 阅读(577) 评论(0) 推荐(0) 编辑
摘要: public class HttpStatus { public final static int CONTINUE_100 = 100; public final static int SWITCHING_PROTOCOLS_101 = 101; public final static int PROCESSING_102 = 102; public final static int OK_200 = 200; public final static int CREATED_201 = 201; public final static int... 阅读全文
posted @ 2012-05-31 13:44 MXi4oyu 阅读(513) 评论(0) 推荐(0) 编辑
摘要: mysql> show table status like 'mytable' \G;*************************** 1. row *************************** Name: mytable 表名 Engine: InnoDB 存储引擎伟InnoDB Version: 10 mysql版本 Row_format: Compact 行格式。有Dynamic,fixed,Compact等格式。Dynamic是动态行,表字段里面宝航varchar,BloB等不定长字段。fixed是定长行。Compact是行压缩。 Ro... 阅读全文
posted @ 2012-05-31 13:38 MXi4oyu 阅读(185) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 70 下一页