
Java
文章平均质量分 78
xgbjmxn
这个作者很懒,什么都没留下…
展开
-
字符编码的知识
(转)神马是UTF-8 收藏<br />本文转自:http://www.ruanyifeng.com/blog/2007/10/ascii_unicode_and_utf-8.html<br />今天中午,我突然想搞清楚Unicode和UTF-8之间的关系,于是就开始在网上查资料。<br />结果,这个问题比我想象的复杂,从午饭后一直看到晚上9点,才算初步搞清楚。<br />下面就是我的笔记,主要用来整理自己的思路。但是,我尽量试图写得通俗易懂,希望能对其他朋友有用。毕竟,字符编码是计算机技术的转载 2011-02-23 12:01:00 · 470 阅读 · 0 评论 -
java缓存处理
java缓存处理(二) <br />缓存的作用在第一论http://hi.baidu.com/%CB%BC%C3%F4%D3%EA/blog/item/908d0cdecbc8a71b495403cc.html中已有部分阐述,下面ahuaxuan和大家一起来学习一下缓存得另外一个重要的规则,近和快. <br /><br />在我们打开浏览器,决定浏览某个网页之前(指人眼看到屏幕上的内容之前),一般来说浏览器有几个事情要做,首先根据url请求服务器端的html数据------,转载 2011-03-07 15:28:00 · 1776 阅读 · 0 评论 -
Java2下Applet数字签名具体实现方法
Java2下Applet数字签名具体实现方法 <br />老文章,用到了就转贴一下,方便记忆。<br />我的项目是使用APPLET制作一个实时消息队列监控程序,由于涉及到了本地资源,对APPLET一定要进行数字签名和认证。我使用的环境是WINDOWS2000,应用服务器是WEBLOGIC6.0,开发环境是JBUILDER4.0。之前我提醒大家一定要注意服务器端和客户端的概念。那些文件应该在服务器端,那些文件应该在客户端。 <br /><br /> 首先在客户端使用JRE1.转载 2011-03-07 16:04:00 · 447 阅读 · 0 评论 -
win2003+Eclipse+Tomcat+Lomboz的配置总结
win2003+Eclipse+Tomcat+Lomboz的配置总结 <br />最近这几天在研究Eclipse插件的配置,也参考了网上的一些帖子,终于把Eclipse+Tomcat+Lomboz配置成功了,下面写出我的配置过程,有什么不妥之处请大家指教。<br />一,下载所需的各种工具和插件(以本机下载的版本举例)<br />j2sdk-1_4_2_01<br />eclipse-SDK-3.0-win32<br />jakarta-tomcat-5.0.16(也可以是其他版本,最好是4。转载 2011-03-07 16:02:00 · 517 阅读 · 0 评论 -
Java的内存泄漏
Java的内存泄漏 出自:ibm:developerworks中国网站 欧阳辰周欣 <br />一 问题的提出<br /><br />Java的一个重要优点就是通过垃圾收集器(Garbage Collection,GC)自动管理内存的回收,程序员不需要通过调用函数来释放内存。因此,很多程序员认为Java不存在内存泄漏问题,或者认为即使有内存泄漏也不是程序的责任,而是GC或JVM的问题。其实,这种想法是不正确的,因为Java也存在内存泄露,但转载 2011-03-07 16:00:00 · 478 阅读 · 0 评论 -
关于静态代码分析
关于静态代码分析 <br />?<br /> 找出代码中已有的缺陷,提高代码质量,排除潜在隐患是每个程序员的责任,不管是入门者还是资深者都被这个问题困扰着。<br />实际开发中会有特别多的伪问题存在,伪问题就是一些不是问题的问题,也可理解成误报。 本来不是问题的地方被当作成问题,无疑会耽误大量时间去发现和排除。由此可见所以静态代码分析尤为重要。<br /> 这里推荐一款我正在使用的工具: Findbugs<br />Find bugs - This is the web page fo转载 2011-03-07 15:56:00 · 674 阅读 · 0 评论 -
code review 工具列表
code review 工具列表 <br />1.代码格式检查checkstyle; <br />2.性能安全最佳实践检查RAD Software Analyzer和FindBug; <br />3.依赖检查JDepend; <br />4.重复性检查eclipse PMD插件; <br />5.复杂度检查eclipse Metrics插件; <br />6.协作工具Jupiter<br /><br />下面是最近对这几个检查工具的使用总结:转载 2011-03-07 15:02:00 · 740 阅读 · 0 评论 -
freqently used java web links
1. find the java class source :http://www.jarvana.com/jarvana/2. find the java jar :http://www.jarfinder.com/3. find the osgi bundle :http://ebr.springsource.com/repository/app/原创 2011-02-18 11:04:00 · 426 阅读 · 0 评论 -
faq of camel and servicemix 4
1. ask: Caused by: java.lang.IllegalArgumentException: org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken [select x from org.apache.camel.processor.idempotent.jpa.MessageProcessed x where x.processorName = ?1 and x.mess原创 2011-02-16 10:33:00 · 931 阅读 · 0 评论 -
camel-file
Avoiding reading the same file more than once (idempotent consumer)<br />Camel supports Idempotent Consumer directly within the component so it will skip already processed files. This feature can be enabled by setting the idempotent=true option.from("f原创 2011-01-31 13:10:00 · 635 阅读 · 0 评论 -
activemq integreted with osgi : install, list , and monitor
<br />This article applies to ActiveMQ version 5.4.0 or newer. If you use an older version proceed to the following article.Introduction<br />All ActiveMQ modules are packaged as OSGi bundles and can be used in any OSGi container. This article will p原创 2011-01-31 12:48:00 · 1386 阅读 · 0 评论 -
JPA Component
JPA Component<br />The jpa component enables you to store and retrieve Java objects from persistent storage using EJB 3's Java Persistence Architecture (JPA), which is a standard interface layer that wraps Object/Relational Mapping (ORM) products s转载 2011-01-31 16:58:00 · 778 阅读 · 0 评论 -
java缓存处理
java缓存处理 java缓存技术一(转)<br /> 看一粒沙中的世界, 一朵野花中的天堂。 把无限握于掌中, 把永恒握于瞬间。——威廉• 布莱克 <br /><br />开始讨论缓存之前,让我们先来讨论讨论另外一个问题:理论和实践.从ahuaxuan接触的程序员来看,有的程序员偏实践,有的程序员偏理论,但是这都是不好的行为,理论和实践同样重要,我们在做很多核心的算法的时候,没有理论根本无从下手,而在我们多年的实践中,不总结理论就不能加深自己的理解.所以理论和实践同等重要.转载 2011-03-07 15:32:00 · 1010 阅读 · 1 评论 -
一些常用的正则表达式
一些常用的正则表达式 <br />"^/d+$"//非负整数(正整数 + 0) <br />"^[0-9]*[1-9][0-9]*$"//正整数 <br />"^((-/d+)|(0+))$"//非正整数(负整数 + 0) <br />"^-[0-9]*[1-9][0-9]*$"//负整数 <br />"^-?/d+$"//整数 <br />"^/d+(/./d+)?$"//非负浮点数(正浮点数 + 0) <br />"^(([0-9]+/.[0-9]*[1-9][0-9]*)|([0-9]转载 2011-03-07 15:53:00 · 395 阅读 · 0 评论 -
字符串格式化--补位--日期时间
字符串格式化--补位--日期时间 收藏 private String formatExecTime(long time) { final int MILLI = 1000; final int SECOND = 60; final int MINUTE = 60; return String.format( "%02d:%02d:%02d", time / MILLI / SECOND / MINUTE, time /转载 2011-02-23 20:35:00 · 805 阅读 · 0 评论 -
Java Resource路径小结
Java Resource路径小结 收藏<br />首先一点很重要,Java中不存在标准的相对路径,各种相对路径取资源的方式都是基于某种规则转化为绝对路劲<br />然后一点也很重要,绝对不要直接使用绝对路径,否则死得很难看<br />基于以上两点,总结Resource路径问题无非归结为一点:找基点,也就是在某种环境下(web、j2ee或jar包等)通过合适的方式找到一个稳定的基点,然后通过这个基点找到你要的resource<br />Java中的基点有哪些呢?大致总结一下有以下几种:原创 2011-02-22 18:20:00 · 432 阅读 · 0 评论 -
以独占的方式访问某个文件
以独占的方式访问某个文件 收藏<br />有时候,我们需要以独占的方式访问某个文件,因此,需要在打开文件时,对文件上锁,以防其他人或进程也访问该文件。Java本身提供了俩种锁文件的方式:<br />方式一:用RandomAccessFile类操作文件<br />RandomAccessFile的open方法,提供了参数,实现以独占的方式打开文件:<br /> new RandomAccessFile(file, "rws")<br />其中的“rws”参数中,rw代表读写方式转载 2011-02-23 20:32:00 · 1241 阅读 · 0 评论 -
97 Things Every Software Architect Should Know
97 Things Every Software Architect Should Know - The BookFrom Softarch 97ThingsJump to: navigation, search<br />The following are the original, unedited contributions for the book 97 Things Every Software Architect Should Know', which is available at转载 2011-02-23 16:37:00 · 570 阅读 · 0 评论 -
软件架构师应该知道的97件事
软件架构师应该知道的97件事<br />2010-04-29 01:55 | 37668次阅读 | 来源:youkuaiyun.com 【已有79条评论】发表评论<br />关键词:架构师 | 作者: | 收藏这篇资讯<br /><br />软件架构师是IT 行业里独一无二的职业,既要精通软件开发技术,又要掌握业务知识,还要周旋于公司不同部门之间,协调各种予盾。做到这些绝非易事, 博文视点 即将翻译出版的新书《软件架构师应该知道的97 件事》(97 Thin转载 2011-02-23 14:32:00 · 431 阅读 · 0 评论 -
从Jetty、Tomcat和Mina中提炼NIO构架网络服务器的经典模式
从Jetty、Tomcat和Mina中提炼NIO构架网络服务器的经典模式(一) 收藏此文于2011-02-18被推荐到优快云首页如何被推荐?如何正确使用NIO来构架网络服务器一直是最近思考的一个问题,于是乎分析了一下Jetty、Tomcat和Mina有关NIO的源码,发现大伙都基于类似的方式,我感觉这应该算是NIO构架网络服务器的经典模式,并基于这种模式写了个小小网络服务器,压力测试了一下,效果还不错。废话不多说,先看看三者是如何使用NIO的。Jetty Connector的转载 2011-02-22 18:08:00 · 1151 阅读 · 0 评论 -
eclipse常用快捷键分类总结
eclipse常用快捷键分类总结 <br /> 1几个最重要的快捷键 <br />代码助手:Ctrl+Space(简体中文操作系统是Alt+/) <br />快速修正:Ctrl+1 <br />单词补全:Alt+/ <br />打开外部Java文档:Shift+F2 <br /><br />显示搜索对话框:Ctrl+H <br />快速Outline:Ctrl+O <br />打开资源:Ctrl+Shift+R <br />打开类型:Ctrl+Shift+T <br />转载 2011-03-07 15:54:00 · 431 阅读 · 0 评论 -
大型互联网应用日志系统
<br />文/沈羽<br /> <br />大型互联网应用的突出特点是应用本身规模大,结构复杂,用户访问量大。设计良好的日志系统,有助于分析流量趋势,帮助管理网络应用;有助于在应用出现问题时,快速查找问题,保证网络应用的可用时间。设计一套完善的日志系统,用于记录应用的内部行为,是一件很有价值的工作。<br />本文希望从设计和实现的角度,描述日志系统的构建。本文的描述,基于Java语言,以及使用Java语言实现的类库。读者可以根据自己的实际需求,替换成其他的实现。日志系统介绍<br />最简单的日志系统其转载 2011-02-17 19:51:00 · 831 阅读 · 0 评论 -
怎样才算掌握J2SE
你真的懂Java吗?(怎样才算掌握J2SE)<br />刚学JAVA的人可以参考参考。<br />时常看到一些人说掌握了Java,但是让他们用Java做一个实际的项目可能又困难重重。在这里,笔者根据自己的一点理解斗胆提出自己的一些对掌握Java这个说法的标准,当然对于新手,也可以提供一个需要学习哪些内容的参考。另外这个标准仅限于J2SE部分,J2EE部分的内容有时间再另说。<br /><br /> 1、语法:必须比较熟悉,在写代码的时候,IDE的编辑器对某一行报错,应该能够根据报错信息知道是什么样转载 2011-03-07 16:11:00 · 488 阅读 · 0 评论 -
Java 理论和实践: 用软引用阻止内存泄漏
Java 理论和实践: 用软引用阻止内存泄漏 在 Java 理论和实践 的 前一期文章 中,Java™ 清洁工程师 Brian Goetz 探究了弱引用(weak references),它让您警告垃圾收集器,您想要维护一个对象的引用,而不会阻止该对象被垃圾收集。在本期文章中,他将解释 Reference 对象的另外一种形式,即软引用(soft references),用于帮助垃圾收集器管理内存使用和消除潜在的内存泄漏。<br />垃圾原创 2011-03-07 16:10:00 · 562 阅读 · 0 评论 -
利用java的keytool创建keystore和证书认证
利用java的keytool创建keystore和证书认证<br />--创建keystore<br />C:/>keytool -genkey -keystore c:/serverstore/serverstore -keyalg RSA -keysize 512 -validity 3650 -alias server -storepass "123456" -keypass "123456"<br />您的名字与姓氏是什么?<br /> [Unknown]: oatest<b转载 2011-03-07 16:08:00 · 878 阅读 · 0 评论 -
Main JPA Interfaces
Main JPA Interfaces<br />Working with the Java Persistence API (JPA) consists of using the following interfaces:This page covers the following topics:OverviewEntityManagerFactoryEntityManagerEntityTransactionOverview<br />A connection to a database is repr原创 2011-01-31 16:52:00 · 685 阅读 · 0 评论 -
Entity Configuration Files
Entity Configuration Files<br /> Introduction : <br /> This section talks about various configuration parameters for getting entities to work within JBoss. JBoss EJB 3.0 is built on top of the Hibernate ORM solution, and m转载 2011-01-31 16:43:00 · 586 阅读 · 0 评论 -
JPA Persistence Unit
JPA Persistence Unit<br />A JPA Persistence Unit is a logical grouping of user defined persistable classes (entity classes, embeddable classes and mapped superclasses) with related settings. Defining a persistence unit is optional when using ObjectDB原创 2011-01-31 16:08:00 · 3864 阅读 · 0 评论 -
Idempotent Consumer
Idempotent ConsumerThe Idempotent Consumer from the EIP patterns is used to filter out duplicate messages. This pattern is implemented using the IdempotentConsumer class. This uses an Expression to calculate a unique message ID string for a given m转载 2011-01-27 10:13:00 · 926 阅读 · 0 评论 -
JMS Component
JMS ComponentUsing ActiveMQ<br />If you are using Apache ActiveMQ, you should prefer the ActiveMQ component as it has been particularly optimized for ActiveMQ. All of the options and samples on this page are also valid for the ActiveMQ component.转载 2011-01-26 19:36:00 · 1594 阅读 · 0 评论 -
Visualisation
Visualisation<br />Camel supports the visualisation of your Enterprise Integration Patterns using the GraphViz DOT files which can either be rendered directly via a suitable GraphViz tool or turned into HTML, PNG or SVG files via the Camel Maven Plugin原创 2011-01-26 19:32:00 · 545 阅读 · 0 评论 -
Asynchronous Processing
Asynchronous ProcessingOverviewSupported versions<br />The information on this page applies for the Camel 1.x and Camel 2.4 onwards. In Camel 1.x the asynchronous processing is only implemented for JBI where as in Camel 2.4 onwards we have impl原创 2011-01-26 19:31:00 · 957 阅读 · 0 评论 -
JBI Component
JBI Component<br />The jbi component is implemented by the ServiceMix Camel module and provides integration with a JBI Normalized Message Router, such as the one provided by Apache ServiceMix.See below for information about how to use StreamSource转载 2011-01-26 18:15:00 · 645 阅读 · 0 评论 -
mechanism of camel2.0
<br />spring dir , camel route context, find routebuilder, configure, from, ---------<br />每次camel 执行from()的时候,都起一个线程?<br />每个routebuilder类,在相应jar包中都只有一个实例?原创 2011-01-26 14:09:00 · 869 阅读 · 1 评论 -
Predicates
Predicates<br />Camel supports a pluggable interface called Predicate which can be used to integrate a dynamic predicate into Enterprise Integration Patterns such as when using the Message Filter or Content Based Router.<br />A Predicate is being e原创 2011-01-26 13:38:00 · 779 阅读 · 0 评论 -
XQuery
XQuery<br />Camel supports XQuery to allow an Expression or Predicate to be used in the DSL or Xml Configuration. For example you could use XQuery to create an Predicate in a Message Filter or as an Expression for a Recipient List.from("q原创 2011-01-26 11:11:00 · 807 阅读 · 0 评论 -
Virtual Destinations
<br />Virtual Destinations allow us to create logical destinations that clients can use to produce and consume from but which map onto one or more physical destinations. It allows us to provide more flexible loosly coupled messaging configurations.Vi转载 2011-01-26 10:56:00 · 971 阅读 · 0 评论 -
activemq
ActiveMQ Component<br />The ActiveMQ component allows messages to be sent to a JMS Queue or Topic or messages to be consumed from a JMS Queue or Topic using Apache ActiveMQ. <br />This component is based on JMS Component and uses Spring's JMS support原创 2011-01-26 10:53:00 · 993 阅读 · 0 评论 -
jms 的基本概念
一、Temporary Destinationsaccess temporary queues Or temporary topics : jms:temp:queue:foo jms:temp:topic:barThis URL format enables multiple routes or processors or beans to refer to the same temporary destinationyou can create three temporary destina原创 2011-01-25 14:58:00 · 2238 阅读 · 0 评论 -
Message Filter
Message Filter<br />The Message Filter from the EIP patterns allows you to filter messages<br /><br />The following example shows how to create a Message Filter route consuming messages from an endpoint called queue:a which if the Predicate is true转载 2011-01-26 13:23:00 · 698 阅读 · 0 评论