Java Tech

Archived Posts from this Category

How to control HTML element when it got focused

Posted by tonny.xu on 31 Oct 2007 | Tagged as: Java Tech

Today, a little bit difficult problem was resolved. The original question is like this:

  • Give a page which mainly contains 2 DIV areas and both have a table element inside it. Each of the DIV tag are set to hidden scroll bar, and these 2 tables are exactly have the same setting(cellspacing, cellpadding, etc. ), so that’s making these 2 tables looks like an excel file which have a freezeed  bar.
  • There are many select boxes and check boxes in these 2 tables, and each element has a tab index value assigned, so that, tab key will navigate element between 2 tables.
  • There is another div element to control the scrolling status and make them scroll at the same time and scroll to same place.(by capture onScroll event.)
  • The problems is when you navigate tab from element to element , the synchronize scroll will be failed.

I tried a lot of ways, and finally find out, the problem lies on the default focus properties deal by Browser itself, and the browser takes control of how to show the element no matter how you set its position properties. And as most of the web programmer will do, we choose to use onfocus event, and can not get the right thing done.

The way to resolve this problem is using another different event : onbeforeactivate

Here is the demo file, you can download it and try it yourself. May be you have a better way to resolve this problem, please let me know: tonny.xu[a]gmail.com

[Download the demo page which works well]

[Download the demo page which doesn't work as we thought]

How to import Maven Project to Eclipse with "pom.xml"

Posted by tonny.xu on 25 Oct 2007 | Tagged as: Java Tech

Struts 2.0.9 bundle shipped with a sample named show-case, if you want to use it in your Eclipse Europa, you need to add a Maven plugin for Eclipse Europa. Please visit this page:

After installed this plugin, you can read a project which shipped with pom.xml, but not normally build.xml. Please follow the steps:

  • Menu<File> ⇒ <Import…> ⇒ General[Maven 2 Project] ⇒ [Select the pom.xml File]

It will really cost you some time, maybe you can drink 2 cups+ coffee before you get your maven project work in your Eclipse. Have Fun.

Besides, because I installed some server adapters before I install Maven 2 Plugin, I had to reinstall Europa before I can use Maven plugin. So, I got a basic rule for eclipse user: Only install the plugin when you need it!

And moreover, the project you imported from Maven to Europa, you need to tweak a lot of configurations, and I suggest you just configure it manual than use Maven plugin.

The most simplest way to use Ant build file. ^_^

Why I can not find the Glassfish server adapter in my company’s computer?(First post after I came to Japan)

Posted by tonny.xu on 24 Oct 2007 | Tagged as: Java Tech

Today, I was preparing the development environment for the new coming project, after installed Eclipse Europa and Glassfish, I need to combine these 2 things together so that I can continue my job.

As usual, I clicked the link below, but this time, I can not find the Glassfish server adapter.

(Click the "Download additional server adapters")008

(Though you can see that I have added GlassFish server adapter, but I will show you where is wrong.)

After I clicked the link, it automatically searching and installing available server adapters for me. My company has a proxy server which is opened on port 8080 and can both serve HTTP and HTTPS, so I setup the proxy server for Eclipse, and I found Geronimo very fast, but, BUT, I can not find this god damn GlassFish server adapter!!

WHY? I have checked the GlassFish project home page, and they said, Europa will search GlassFish’s web site for the latest available plugin automatically, but why it don’t show itself to my Europa??? and at the same time, BEA’s server adapter is also missing from the available list.

Then I want to take a deep look into the Eclipse to find out whether those GlassFish guys really put their Web site URL to Europa, but to tell the truth, it’s not a easy work. I can not find out where they configure the necessary URL to search for. Then after I wasted few time to redo it again, Finally, Suddenly, I found out why!

BECAUSE Some sites used a SSL connection for their god damn update URL, and I didn’t configured to use proxy for SSL connection! While others are all using simply HTTP connection!

009

DAMN IT!

So, next time, don’t forget to set up your SSL connection proxy!

OutOfMemory:PermGen Space异常的处理和分析

Posted by tonny.xu on 15 Aug 2007 | Tagged as: Java Tech

Java程序员没有遇到过OutOfMemory简直就是不可能的事情!

可见在Java的世界中,太多的不确定因素导致Java运行程序直接崩溃,直接抛出OutOfMemory异常,而一旦遇到了这个问题,调查起来就非常的困难。在JDK 5.0以前,OutOfMemory只有这么一句话: java.lang.OutOfMemory Exception…基本上无从下手,无从分析。从JDK 5.0以后对OutOfMemory增加了许多的详细说明,为这个异常的分析提供了很大的便利。

这次遇到的问题就是会抛出OutOfMemory:PermGen Space的异常,这个异常非常有意思,根据【此文章】的描述,这是一个Sun JVM的bug,从2003年开始,一只到现在都没有解决。而且提出来的解决方案是使用JRockit。Bug产生的原因已经找到,就是因为JVM在分配PermGen Space的时候出现了PermGen Space不足的情况,默认情况下 PermGen的大小为64M,在不换用JRockit的情况下,可以在启动JVM的时候添加一个参数: -XX: MaxPermSize= 128m| 256m| 512m。

那么究竟什么是PermGen呢?

PermGen 原来是指Permanent Generation,本身是在Java的垃圾收集机制(GC)中产生的一个概念。Java的垃圾收集机制最早只是遍历所有的对象,如果发现某个对象没有被引用,则回收,这是在早期的Java 1.0和Java 1.1的时候的GC规则。慢慢的,这样一种“愚蠢的”GC算法成为了JVM性能的瓶颈,在拥有大量数据的Java应用程序中,GC的算法被高度强化,于是各种各样高效的JVM GC算法被发展了起来。从J2SE也就是Java 1.2开始,JVM引入了多种GC算法,其中一种用的非常多的就是Generational Collection,中文也叫做“分代收集法”。

分代收集法摈弃了对所有对象的遍历,而是采用一些经验属性去避免额外的工作(While naive garbage collection examines every live object in the heap, generational collection exploits several empirically observed properties of most applications to avoid extra work)。其中导入了一个非常关键的概念:infant mortality (幼儿死亡率),这表示越是新生成的变量或者对象,越容易被收集。下面一张图表示了对象的生命周期,横轴表示的是测试到对象的生命周期,纵轴表示在一个指定的生命周期上被回收的对象数量。

Histogram of lifetime

可以看到,在使用了分代收集法以后,年轻一代的对象被收集的比例最高。并且在内存中的对象会按照不同的“年龄”来划分,当一个年龄段的对象满了以后,在这个年龄段上就会发生垃圾收集,从最年轻的一代开始,一直到“永生代”,在内存中,所有的对象可以划分为很多代,最后的一代“永生代”就是“Permanent Generation”,这里就是直接引出“Permanent Generation”概念的地方。具体可以参考下图:

根据前面所说的情况,在分代垃圾收集的情况下会产生Permanent Generation的概念,而这个分代垃圾收集法是并行收集和并发收集的基础,所以Permanent Generation会一直存在,那么这个Permanent Generation究竟是做什么用的呢?这里保存了JVM中所有对象的类信息,包括类的元数据,还有方法描述等等,所以这一代内存垃圾收集算法是不一样的,在Java大程序的情况下,尤其是J2EE 或者说Java EE的大型应用程序上,Permanent Generation的大小会直接限定能载入类的数量和大小。

【解决办法】就是设定JVM启动的时候参数,可以如下设置:

java -XX: PermSize=64m -XX: MaxPermSize=128m

另外PermSize 和MaxPermSize如果设置为相同还可以在一定程度上提高性能,因为,PermSize在不断的变化中会需要转移其中的数据。如果固定了以后,则可以减少每次扩大PermSize带来的性能损失。

更多的请参考 【Java官方站点】

另外,还可以在Java启动的时候添加下面的参数来看GC的运行情况:

Java -verbosegc

(完)

Part II: How to use JConsole

Posted by tonny.xu on 10 Aug 2007 | Tagged as: Java Tech

接着前一篇Blog,现在JConsole已经可以启动了。而且JMX的配置方面也整理了一下。JConsole的具体使用界面上,有以下这样的一些截图:

连接上远端的JVM以后可以通过JConsole看到如下截图:

图1:“概述”界面

图2:“内存”界面

图3:“线程”界面

图4:“类”界面

图5:“VM 摘要”界面

图6:“MBean”界面

前面的5个标签页,主要通过图表的方式,将JVM的运行状况用图表的方式表示出来,可以看到内存,CPU,线程,类的概况,以及各个方面的详细图表情况,这样的图表方式可以非常方便的看到系统运行时的压力以及瓶颈在哪里。

第六张标签页显示了MBean的情况,MBean是JMX体系下的一种JavaBean,可以通过MBean所提供的方法,获取某个具体对象的运行情况,甚至可以得到一些对象的Dump数据。MBean非常的多,使用方法也比较麻烦,具体请参看下面的文章:Overview of Monitoring and Management.

(完)

Part I: How to use JConsole

Posted by tonny.xu on 09 Aug 2007 | Tagged as: Java Tech

JConsole是一个JDK中提供的JVM监视与管理的工具,主要是通过JMX来提供监视与管理。

默认情况下,JVM是不启动JMX服务,并提供被监视与被管理的能力的,必须在启动Java程序之前,在Java [opt] [app]中指定JMX的服务。JConsole提供本地和远程的两种监管方式,远程又可以分为直接监视,另外一种是通过JMX的服务器来管理。

根据目前我的需要,我举一个很简单的远程监管例子。因为JConsole本身也要耗费一定的资源,所以用远程方式是比较推荐的。

首先启动JConsole:

(因为在日文系统中,所以显示的为日文)

选择下面的Remote Access,输入host:portNumb的格式,另外输入用户名和密码,用户名和密码存储在<JAVA_HOME>/lib/management目录下,将jmxremote.password.template 复制为management.jmxremote.password(如果需要可以将文件的只读属性打开)。注意:这个文件是放在JRE的lib目录下。修改过以后的内容大致如下:

######################################
# File permissions of the jmxremote.password file
######################################
# …

monitorRole 333
controlRole 333

另外,默认情况下,SSL是被打开的,需要在被监视的机器上生成相应的SSL证书。在Java中可以使用keytool来生成,具体步骤如下:

  • 在命令行输入 keytool -genkey
  • 其次输入 keytool -certreq 来生成一个签名过的证书
  • 将证书导入 keytool -import
    1. KeyTool具体的用法参考下面两个链接: (Solaris and Linux) (Windows).
    2. 以上第一个命令会产生一个.keystore的文件,保存在c:\documents and setting\<username>\.keystore

其中第三条将需要你将第二步生成的CSR文件提交给VeriSign这样公司验证,然后返回给你一个可以使用CER证书,然后在Import,我们主要目的是为了体验JConsole,所以这一步我们就略过。所以我们设定不使用SSL,具体设置如下:

-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false

注意:这两行将使用非认证,非SSL的情况,在真实的服务器上要小心,很容易留下漏洞的。

在Windows系统下,如果你将Tomcat安装为服务模式,则可以在右下角Tray 图标中点击配置Tomcat,可以在例如下图的属性中配置,非常的简单:

如果不使用Windows系统,则需要在Catalina.bat中改写Java运行的参数。

改完了Tomcat的配置,启动Tomcat。

在远程机器上点击JConsole的连接即可。JConsole的具体使用以及分析下次继续。

——————————————————-
JMX 的配置主要在Java程序启动的时候使用,这里重新整理了一下,更加清晰易懂一些:

方法1: 最简单的方式:不用密码,不用SSL

-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.port=<define a random port>

方法2: 使用密码,不用SSL

-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access

$CATALINA_BASE/conf/目录下添加jmxremote.password文件,并添加下面两行:

monitorRole <Your password>
controlRole <Your password>

$CATALINA_BASE/conf/目录下添加jmxremote.access文件,并添加下面两行:

monitorRole readOnly
controlRole readWrite

这两种方法是最简单的,并且第二种方法具有一定的安全性。具体可以参考Tomcat的文档:Monitoring

The coming revolution

Posted by tonny.xu on 06 Mar 2006 | Tagged as: Java Tech

Java is facing a revolution on desktop because of the coming Java SE 6.0, Sun just released the first beta version of Java SE 6.0 a few days ago, and a log of people is making a test drive on it.

Here I present you an article which is highlighted on Sun's Java office site, and I think it will help u understand the new features better.

To view the original article, please click HERE.

初探Java SE 6: 一个桌面赢家

一个有着丰富的Java经验的开发者试用了一下Java SE 6 Beta,并且认为Java SE 6 有希望成为桌面开发的一次革命。

by Eric Bruno (Translated by Xu Ting)

刚刚发布的Java Standard Edition 6 (Java SE 6,也被称为Mustang)beta版完整的包括了预定的新特性,对于主流的应用来说,已经足够稳定。我在第一时间下载并尝试了这个新?动物?,并且被它全新的桌面特性所震撼。除了Java平台一贯以来的命名方式上的改变(去掉了2),它还包含了包含了很多值得探索一下的新特性。这些新特性可以分为两类:桌面和核心。

桌面上的改进主要集中在用户界面(UI)性能,以及,用本地化的接口与OS的桌面整合。核心部分则集中在提高开发人员的生产性,以及Java程序的可管理性上。Sun的Mustang团队也对Web Service以及安全性方面作出了显著的改进。

不管怎么样,无论你是一个应用程序开发人员,还是一个系统管理者,或者提供独立的工具,或者是一个安全专家,Java SE 6都为你准备了些东西。这片文章主要是详细讨论了一些我试用过了的有趣的特性。

有关Java核心的新特性以及改进。

关于Java 核心部分,我们认为是部分((语言和工具)对所有的Java而言都是很基础的东西,包括从界面API到服务端API库。下面我将按照不同的分类来讨论这些与Java核心相关的特性。

开发人员的生产性

新的Java编译器API允许你从一个Java应用程序中去编译另外的Java源程序。在这样的编译的过程中,应用程序将根据计算出来的依赖关系去访问那些相关的API库文件,这个过程也会产生Warning,Error以及其他一些在编译的时候会产生的消息。虽然这个功能是我不太会常去用的,但是我很快发现了一种用法。比如:我在我的应用程序A中,快速的用这个特性来编译A的数据访问层代码。我可以用我的代码去生成并且编译我在A程序中要去访问的数据库表的类,最终的结果可以是一个从Ant脚本中生成出来的JAR文件。这样最显而易见的一个事实就是我可以在自己的程序中去重新编译生成这些重要的文件,至少我可以不需要改动应用程序。

Java Scripting,是在Java SE6中实现了的JSR223。这是一个脚本框架,提供了让脚本语言来访问Java内部的方法。你可以在运行的时候找到脚本引擎,然后调用这个引擎去执行脚本。这个脚本API允许你为脚本语言提供Java支持。另外,Web Scripting Framework允许脚本代码在任何的Servlet容器(例如Tomcat)中生成Web内容。

对于调试,Java平台的调试器(JPDA)已经提供了死锁诊测,并且可以为产生了死锁的对象生成堆栈信息。另外,Java SE 6允许在一个运行中的JVM上,添加不同的诊断工具 。

应用程序管理

Java SE 6中对内存泄漏增强了分析以及诊断能力。当遇到java.lang.OutOfMemory异常的时候,可以得到一个完整的堆栈信息,并且当堆已经满了的时候,会产生一个Log文件来记录这个致命错误。另外,JVM还添加了一个选项,允许你在堆满的时候运行脚本。(这也就是提供了另外一种方法来诊断错误)

增强的JMX 监视API在MBean的属性值传入了一个特定的参数的时候,允许这个应用程序发送一个事件通告。(这里的属性值可以在很复杂的类型中)

对于Solaris 10的用户,为Solaris提供的Hotspot JVM中,提供了一种通过Solaris DTrace(这是个系统的调试工具)来追踪显示JVM内部的活动情况,包括垃圾收集,类装载,线程,锁等等。我在JavaOne上得到了一个第一手的DEMO,这个DEMO所显示的能追踪到的详细情况简直是太棒了。比如,当一个应用程序运行的时候,DTrace允许可以在任何地方中止代码,查看所有被载入内存的库(不仅仅是Java的类库,甚至是系统级别的库),并且可以单部跟踪到Solaris的内核中去,甚至可以直达硬件!Java新提供的这个工具为全世界提供了一种系统级别的追踪调试手段。我还记得以前我在Solaris的JVM上经常会收到一些Signal8这样的错误,这个特性将会省去我许多的猜测。

Web services

Java SE 6 包含了一些支持Web Services的新API。XML 数字签名API,允许你为基于Java上的Web Services数据提供加密的可能。Java-XML Web Services (JAX-WS)2.0API更新的以前称为JAX-RPC的API库。增强的Java-XML Binding (JAXB)2.0包含了对XMLSchema的支持,以及将某个Class绑定到一个Schema上去。最后, Streaming API for XML (STaX)提供了一个双向API,这个API可以通过一个事件流来读取或者写入XML,其中包括跳过某个部分,然后直接关注与文档中的另外一个小部分的能力。

安全

Java SE 6的安全部分,整合了GSS/Kerberos的操作API,LDAP上的JAAS认证,以及一个?请求安全认证?的框架,这个框架允许应用程序从一系列的协议中选择一种?请求安全认证?所用的协议。

桌面特性以及改进

Java长久以来,一直被认为是一个一流的服务器端软件的语言,但是桌面GUI应用上只能是二流地位。 Sun的Java桌面工作小组正在努力改变这个现状。通过调用系统的GUI接口,来更好的显示Java 的GUI应用。他们的努力不仅改善了Java SE 6中的GUI性能,也改变了一些Java GUI应用程序的行为。(比如提供了DnD的支持)

Java SE 6中的桌面新特性,大部分 都来自于JDesktop Integration Components(JDIC)项目。JDIC项目为Java的应用程序提供了访问OS底层本地桌面GUI接口的方法,例如浏览器,Email编辑器,文件类型绑定,系统托盘,阴应用程序启动,打印等等。 下面是那些Java SE 6中最显著的一些桌面特性。

  • 启动界面的支持。启动界面(Splash Screens)是一个应用程序启动的时候,用户等待的时候给用户看的界面。Java SE 6中的启动界面甚至可以在JVM启动之前显示出来。
  • JFC以及Swing中的改进:
    • Java SE 6通过调用Windows的API,不仅提高了 GUI的性能,也保证了在当前以及以后的Windows版本中的兼容
    • 增强的布局管理包含了一个可定制的布局管理,另外还包含了一些使得GUI元素布局的时候更加简单的方法。
    • Java SE 6中显著的增强了Swing控件的托拽功能,并且是可以定制的。
    • 真正的双缓冲,提供了快速,平滑的图形效果。
  • 系统托盘的支持。在java.awt包中,增加了SystemTray和TrayIcon两个类,它们允许你在Windows或者使用GNome的Linux的系统托盘区,添加图标,提示信息,弹出菜单。系统托盘区是所有的应用程序都共享的区域,通常在屏幕的右下角。通过系统的动作和事件可以允许你的Java应用程序去相应在托盘区的鼠标事件。我发现这个特性也同样对我的服务器程序非常有用,比如,我可以通过桌面API,非常轻松的启动一个浏览器,并且打开这个服务器程序的管理界面(当然,是HTML页面)。在Linux或者Window上,我再也不需要自己输入管理界面的URL和端口号了,只要简单的点击一下托盘图标就可以:)
  • JTable支持打印了
  • Java 2D方面增强了许多。 主要是在字符显示上,尤其在LCD的显示屏上。整合了许多字体反锯齿的设定来保证平滑的显示文字。
  • 新的java.awt.Desktop包。Java SE 6中这个新的包目标是让Java 的GUI应用程序成为?一等公民?。 有了这个包,Java的应用程序可以启动默认的浏览器和邮件客户端,并且整合了一些通用桌面应用程序的启动。例如启动OpenOffice,然后打开,编辑,打印一些制定的类型。Desktop包通过action事件来实现的,你可以将这些Action整合到你的应用程序中去。
  • 国际化。Java SE 6提供了一些本地化特性的可扩充性,比如日期格式,Unicode文字的一致性,资源簇等等。

一场Java桌面革命

Java SE 6提供了许多的特性,改进,bug修改等 (这些可以参考我的另外一篇翻译),本文旨在对Java这个即将到来的重要版本之前做一个历史的记录。 这个改动涉及到了Java SE如此多的方面,乃至几乎所有的Java应用程序都会被波及到,包括那些Java EE的应用程序。

Java SE 6有潜力成就一场桌面革命,就如同Java 2成就了一场服务器革命。最好是现在就为这场即将到来的风暴做好准备,让你自己成为革命的先锋人员。

Eric Bruno is a New York-based consultant who has built high-volume Web applications, database systems, and real-time transactional systems in Java and C++. Visit www.ericbruno.com for more about him.

New features in Java SE 6.0

Posted by tonny.xu on 06 Mar 2006 | Tagged as: Java Tech

A few days ago, Sun just released Java SE 6.0 Beta. And I had viewed the release notes and some articles discussed the new features .

Here is a translation about the new features and enhancement list provided by Sun officially. And I had translated this to Chinese(Simplified Chinese.)

The original document is placed HERE.

Here is the translation.
#Thanks to Zou, he helped me review this translation.
#There are some features about the compiler and VM are remained as original, because I am short at this areas. If you have any suggestions, please leave your comments of send a mail to my mailbox: tonny.xu[a]gmail.com

Java SE 6.0(代号?Mustang")是即将面世的下一版本Java。相比较J2SE 5.0,添加了许多重要的特性和增强功能,这些新特性和增强功能如下面的列表。

所有的条目都按照涉及范围以及所属的组件分类。第一列表示了修改涉及的范围。

  • JSR - 表示这是实现了某一项JSR(Java标准需求)的重大特性
  • API - 表示新添加的API
  • IMP - 表示没有增加新的API,只是作了一些类似性能增强的改进。

请注意:这是个Beta里程碑,?Mustang?还在继续开发中。这些都是JSR270中的内容。JSR270本身并没有定义新的特性,但是它列举了一系列的其他JSR或者是正在进行评审中的需求。?Mustang?的最终发布版的目标是包含JSR270中所有的特性,但是不保证(有些已经商议通过的特性可能最终不会在?野马?版本中实现)。

范围 涉及到的组件或者技术领域 摘要 可参考的记录
api client/2d ImageIO: GIF writer 4339415
imp client/2d Native Text Rendering Parity
本地化文字渲染支持
4726365
imp client/2d Improved hardware acceleration on Windows
利用Windows平台的硬件加速得到改进
5104393
imp client/2d Single-threaded rendering for OpenGL pipelines
为OpenGL管道实现了单线程渲染
6219284
api client/awt Pop-up splash screen at beginning of Java startup
在启动的时候能跳出启动画面
4247839
api client/awt Java applications can access desktop applications
Java应用程序可以访问桌面应用程序
6255196
api client/awt Improved modal dialogs
改进的模式对话框
4080029
imp client/awt XAWT is the default Toolkit on Solaris
在Solaris上,XAWT是默认的图形化接口
5049146
api client/awt Windows system-tray support
支持Windows收缩到Windows系统图标区
4310333
imp client/awt Better support for input in non-English locales
对非英文文字输入有更好的支持
4360364
imp client/awt Live resizing
(窗体元素)全时自动缩放
6199167
imp client/deploy Improved application deployment across browsers
改进了跨浏览器的应用程序部署
6329487
imp client/deploy Improved user experience in JRE/JDK installer
在JRE/JDK的安装过程中更加友好的用户体验
5079209
imp client/deploy Improved security
安全性有所改进
6222485
imp client/deploy Direct execution of JAR files on Linux
在Linux上支持直接执行JAR文件
6211008
imp client/deploy Improved desktop integration in Java Web Start
在JavaWebStart中,和桌面整合部分有所改进
4625362
imp client/deploy Improved IFTW installer
IFTW安装程序有所改进
6198632
imp client/deploy Improved startup & footprint for plugin/webstart
对插件和WebStart的启动/追踪有改进
6329480
imp client/deploy Mozilla Firefox browser support
支持Mozilla的Firefox浏览器
6216340
imp client/deploy Default Java on Linux
Linux系统中支持默认JVM
6211006
imp client/deploy Improved user experience in Java Plug-in and Java Web Start
对Java插件以及JavaWebStart中的用户体验有所改进
6205064
imp client/deploy Unified download engine
统一的下载引擎
4802551
imp client/deploy Support Mozilla and Firefox family browsers.
支持所有Mozilla和Firefox系列浏览器
6216340
api client/dnd A way to avoid hangs on retrieval of clipboard data
添加一种方法,用来防止从剪贴板读取数据时系统瘫痪
4818143
imp client/i18n Support for important locales
支持一些重要国家的本地化支持(文字,汇率,时间日历)
4324505
imp client/i18n Japanese calendar
支持日本日历
4609228
api client/i18n Resource bundle enhancements
增强了对资源包的定制功能
5102289
api client/i18n Normalizer API
提供文字正规化的API
4221795
api client/i18n Pluggable locales: Pluggability for break iterators
BreakIterator现在是可扩展的了
4052440
api client/i18n Pluggable locales: Pluggability for locale names, formatters, and collators
LocalNames,Formatters,Collators现在是可扩展的了
4052440
imp client/l10n Chinese localization for JDK tools
提供了JDK工具的中文化支持
6209342
imp client/swing GTK Native L&F Fidelity
本地化的GTK Look&Feel支持
6185456
imp client/swing Through-the-stack: Reduced footprint / startup time
改进的堆栈处理,减少启动和追踪时间
6329480
imp client/swing Native look & feel fidelity
改进了本地化的Look&Feel支持
JSR 15: Image IO Framework
JSR 183: Web Services Message Security APIs
JSR 185: Java Technology for the Wireless Industry

imp client/swing Avalon Look-and-Feel
支持Avalon的Look&Feel
6329475
api client/swing JTable sorting, filtering, and highlighting
新增对Jtable的排序,过滤,高亮支持
4747079
api client/swing JTabbedPane: Tabs as components
新增对JTabbedPane支持:Tabs可以作为组件
4499556
imp client/swing Windows native L&F fidelity
Windows平台上本地化的Look&Feel支持
5106661
api client/swing SwingWorker
新增SwingWorker(遗漏的API)
4681682
api client/swing Improve Drag & Drop features for Swing Components
对Swing控件提供拖拽支持(DnD)
4468566
api client/swing Extend SpringLayout
新增扩展的SpringLayout布局方式
4726194
api client/swing Text Document printing
新增文本文件打印支持
4791649
imp client/swing Improved painting performance (fix grey boxes)
改进了对固定大小灰色框的上色过程
4967886
jsr core/core JSR 223: Scripting for the Java Platform
实现了JSR223,新增了对Java平台的脚本化支持
6249843
api core/debug Multiple simultaneous agents
新增多个应用程序的并行调试
4772582
api core/debug Added heap capabilities to JPDA
对JPDA新增了堆容积
4914266
api core/debug Attach-on-demand
JVM支持按需添加诊断工具(类似Debug,Jconsole等等)
6173612
api core/debug JVMPI and JVMDI have been removed.
JVMPI和JVMDI已经被去除了。
4914266
api core/jndi Read-timeout specification for LDAP operations
新增LDAP操作的Read-Timeout标准
6176036
api core/libs array reallocation API
新增数组重分配API
4655503
imp core/libs BigDecimal optimizations for specjbb++
为SpecJBB++优化了BigDecimal
api core/libs Floating point: Add IEEE 754 recommended functions to java.lang.{{,Strict}Math}
在java.lang.Math类中添加了IEEE754推荐的浮点方法
4406429
api core/libs Standard service-provider API (java.util.Service)
新增标准的Service-Provider类
4640520
api core/libs Updates to java.util.concurrent
对java.util.concurrent类进行了更新
6268386
api core/libs IO Enhancement: Password prompting
新增IO特性:Password提示
4050435
api core/libs IO Enhancement: File attributes
新增IO特性:文件属性
6216563
api core/libs IO Enhancement: Method for discovering free disk space
新增IO特性:提供查找某个分区剩余空间的方法
4057701
imp core/libs IO Enhancement: Long pathnames on Windows
新增IO方法:Windows平台上的长路径名
4403166
api core/libs Low-level Java compiler API for IDEs
新增对IDE提供支持的底层Java编译器API
4813736
jsr core/libs JSR 202: Java Class File Specification Update
实现了JSR202,按照JavaClass文件的标准更新的Class文件的结构
4

Inside JavaSE 5.0 Part I

Posted by tonny.xu on 09 Feb 2006 | Tagged as: Java Tech

About Annotation

What's is annotation?

Annotation is a metadata or data of data. In Java that means the data of those Java elements.

JavaSE 5.0 including 7 build-in annotations:

  • java.lang.Override (@Override)
    Means this method is overriding a method in superclass
  • java.lang.Deprecated (@Deprecated)
    Means this method is already deprecated, when u use it, the compiler will throw out a warning message.
  • java.lang.SuppressWarning (@SuppressWarning)
    Means some kind of warning specified by SuppressWarning will be suppressed, and all the specifed warning generated by the child element of which marked @SuppressWarning will also be suppressed.
  • java.lang.annotation.Documented (@Documented)
    Means the element annotated are to be documented by javadoc.
  • java.lang.annotation.Inherited (@Inherited)
    Means the annotation type is automaticlly inherited. When those class did not used this annotation type to be queried, the superclass will also be quired
  • java.lang.annotation.Retention (@Retention)
    Stands for a restriction of annotation retention. Could be SOURCE or CLASS or RUNTIME. Default is CLASS
  • java.lang.annotation.Target (@Target)
    Stands for a restriction of element that can comsume this annotation type. Default is full element.

What's the benifits from annotation?

In general, metadata annotation benifits fall into 3 categories:

  • Documentation
  • Compiler checking
  • Code analysis

Annotation is useful to JavaEE and similar to XDoclet, but it's now fully supported by JRE.

Something u might not know about Apache Group

Posted by tonny.xu on 13 Nov 2005 | Tagged as: Java Tech

Something that you might not know:

  • Apache is originally as a patch of the first web server developed by Rob McCool when he was working at NCSA (NCSA = National Center for Supercomputer Applications) server. It?s a short of acronym of ?A PAtCHy Web Server?
  • 1999, the same folks who wrote the Apache server formed the Apache Software Foundation (ASF). The ASF is a non-profit organization created to facilitate the development of open source software projects.
  • The ASF license is much more loose than GPL or LGPL, ASF is allowed to be freely redistribute the products which is under ASF license.
  • If you want to integrate Apache and Tomcat there are 2 ways: AJP and WARP. AJP stands for Apache JServ Protocol, and first appeared with Tomcat 3.x to integrated with Apache server which using a mod_jserv for Apache. As Tomcat goes into version 4.x the new AJP is named as mod_jk2. WARP is another connector only for Tomcat 4.x series and provided greater flexibility and greater performance than AJP. WARP is using a connector named mod_webapp and currently is the only connector which implemented WARP protocol.

Next Page »