rt
解决方案 »
- Action添加session 在HttpServlet 中获取不到session 中的值
- 第一个jsp页面就遇到问题
- 求助!!ajax跳转到servlet问题。。。
- 关于数组长度的问题
- 老问题,utf-8.高分求解!
- 有谁知道用java怎么对文本信息进行HTML编码,即把"<",">"进行html编码,转成"<",">"
- Tomcat5.5已经配置好连接池,但我想对使用情况监控一下,如何实现
- 怎样解决共享变量的问题
- 用jbuilder做struts时遇到一个这样的问题---郁闷。
- 这样声明对吗??在线等!
- 关于2个JSP页面间的数据传递问题
- 用JSP开发Wap网站,嵌入数据库出问题了
For a synopsis of performance enhancements, see Performance Enhancements. --------------------------------------------------------------------------------JavaTM Language Features
For more information see New Language Features.
Generics
This long-awaited enhancement to the type system allows a type or method to operate on objects of various types while providing compile-time type safety. It adds compile-time type safety to the Collections Framework and eliminates the drudgery of casting. Refer to JSR 14.
Enhanced for Loop
This new language construct eliminates the drudgery and error-proneness of iterators and index variables when iterating over collections and arrays. Refer to JSR 201 .
Autoboxing/Unboxing
This facility eliminates the drudgery of manual conversion between primitive types (such as int) and wrapper types (such as Integer). Refer to JSR 201 .
Typesafe Enums
This flexible object-oriented enumerated type facility allows you to create enumerated types with arbitrary methods and fields. It provides all the benefits of the Typesafe Enum pattern ("Effective Java," Item 21) without the verbosity and the error-proneness. Refer to JSR 201.
Varargs
This facility eliminates the need for manually boxing up argument lists into an array when invoking methods that accept variable-length argument lists. Refer to JSR 201.
Static Import
This facility lets you avoid qualifying static members with class names without the shortcomings of the "Constant Interface antipattern." Refer to JSR 201.
Metadata (Annotations)
This language feature lets you avoid writing boilerplate code under many circumstances by enabling tools to generate it from annotations in the source code. This leads to a "declarative" programming style where the programmer says what should be done and tools emit the code to do it. Also it eliminates the need for maintaining "side files" that must be kept up to date with changes in source files. Instead the information can be maintained in the source file. Refer to JSR 175. --------------------------------------------------------------------------------Virtual Machine
Class Data Sharing
The class data sharing feature is aimed at reducing application startup time and footprint. The installation process loads a set of classes from the system jar file into a private, internal representation, then dumps that representation to a "shared archive" file. During subsequent JVM invocations, the shared archive is memory-mapped in, saving the cost of loading those classes and allowing much of the JVM's metadata for these classes to be shared among multiple JVM processes. For more information, click the above link.
Garbage Collector Ergonomics
The parallel collector has been enhanced to monitor and adapt to the memory needs of the application. You can specify performance goals for applications and the JVM will tune the size of the Java heap to meet those performance goals with the smallest application footprint consistent with those goals. The goal of this adaptive policy is to eliminate the need to tune command-line options to achieve the best performance. For a synopsis of garbage collection features, click the above link.
Server-Class Machine Detection
At application startup, the launcher can attempt to detect whether the application is running on a "server-class" machine.
Thread Priority Changes
Thread priority mapping has changed somewhat allowing Java threads and native threads that do not have explicitly set priorities to compete on an equal footing.
Fatal Error Handling
The fatal error reporting mechanism has been enhanced to provide improved diagnostic output and reliability.
High-Precision Timing Support
The method System.nanoTime() has been added, providing access to a nanosecond-granularity time source for relative time measurements. The actual precision of the time values returned by System.nanoTime() is platform-dependent. --------------------------------------------------------------------------------Base Libraries
Lang and Util Packages
For a synopsis of java.lang and java.util enhancements, click the above link. Networking
For a synopsis of added networking features, click the above link.
Security
This release of J2SE offers significant enhancements for security. It provides better support for security tokens, support for more security standards (SASL, OCSP, TSP), improvements for scalability (SSLEngine) and performance, plus many enhancements in the crypto and Java GSS areas. For details see the above link.
Internationalization
Enhancements are as follows:
Character handling is now based on version 4.0 of the Unicode standard. This affects the Character and String classes in the java.lang package, the collation and bidirectional text analysis functionality in the java.text package, character classes in the java.util.regex package, and many other parts of the J2SE. As part of this upgrade, support for supplementary characters has been specified by the JSR 204 expert group and implemented throughout the J2SE. See the article Supplementary Characters in the Java Platform, the Java Specification Request 204, and the Character class documentation for more information.
The DecimalFormat class has been enhanced to format and parse BigDecimal and BigInteger values without loss of precision. Formatting of such values is enhanced automatically; parsing into BigDecimal needs to be enabled using the setParseBigDecimal method.
Vietnamese is now supported in all locale sensitive functionality in the java.util and java.text packages. See the Supported Locales document for complete information on supported locales and writing systems.
Improved Support for Environment Variables
The System.getenv(String) method is no longer deprecated. The new System.getenv() method allows access to the process environment as a Map<String,String>.
ProcessBuilder
The new ProcessBuilder class provides a more convenient way to invoke subprocesses than does Runtime.exec. In particular, ProcessBuilder makes it easy to start a subprocess with a modified process environment (that is, one based on the parent's process environment, but with a few changes).
FormatterJavaTM Management Extensions
JMXTM API version 1.2 and the RMI connector of the JMX Remote API version 1.0 are included in J2SE 5 release. The JMX API allows you to instrument libraries and applications for monitoring and management. The RMI connector allows this instrumentation to be remotely accessible. See the JMX documentation for more details.
Remote Method Invocation (RMI)
RMI has been enhanced in the following areas:
Dynamic Generation of Stub Classes - This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use the Java Remote Method Invocation (Java RMI) stub compiler, rmic, to pregenerate stub classes for remote objects. Note that rmic must still be used to pregenerate stub classes for remote objects that need to support clients running on earlier versions.
Standard SSL/TLS Socket Factory Classes - This release adds standard Java RMI socket factory classes, javax.rmi.ssl.SslRMIClientSocketFactory and javax.rmi.ssl.SslRMIServerSocketFactory, which communicate over the Secure Sockets Layer (SSL) or Transport Layer Security (TLS) protocols using the Java Secure Socket Extension (JSSE).
Launching rmid or a Java RMI Server from inetd/xinetd - A new feature, provided by the System.inheritedChannel method, allows an application to obtain a channel (java.nio.channels.SocketChannel or java.nio.channels.ServerSocketChannel, for example) inherited from the process that launched the virtual machine (VM). Such an inherited channel can be used to either service a single incoming connection (as with SocketChannel) or accept multiple incoming connections (as with ServerSocketChannel). Therefore, Java networking applications launched by inetd (Solaris(tm) Operating System) or xinetd (Linux) can now obtain the SocketChannel or ServerSocketChannel inherited from inetd/xinetd. Java Database Connectivity (JDBC)
RowSet interface, part of the javax.sql package, introduced in J2SE version 1.4, provides a lightweight means of passing data between components.
At this release, as an aid to developers, the RowSet interface has been implemented (as JSR 114) in five of the more common ways a RowSet object can be used. These implementations provide a standard that developers are free to use as is or to extend. Following are the five standard implementations: JdbcRowSet - used to encapsulate a result set or a driver that is implemented to use JDBC technology
CachedRowSet - disconnects from its data source and operates independently except when it is getting data from the data source or writing modified data back to the data source. This makes it a lightweight container for as much data as it can store in memory.
FilteredRowSet - extends CachedRowSet and is used to get a subset of data
JoinRowSet - extends CachedRowSet and is used to get an SQL JOIN of data from multiple RowSet objects
WebRowSet - extends CachedRowSet and is used for XML data. It describes tabular components in XML using a standardized XML schema.
CORBA, Java IDL, and Java RMI-IIOP
Enhancements to CORBA, Java IDL, and Java RMI-IIOP are discussed in Changes in CORBA Features Between J2SE 1.4.x and 5.0. Java Naming and Directory InterfaceTM (JNDI)
JNDI provides the following new features.
Enhancements to javax.naming.NameClassPair to access the fullname from the directory/naming service
Support for standard LDAP controls: Manage Referral Control, Paged Results Control and Sort Control
Support for manipulation of LDAP names. --------------------------------------------------------------------------------User Interface
Internationalization
To render multilingual text, using logical fonts, 2D now takes advantage of installed host OS fonts for all supported writing systems. For example, if you run in a Thai locale environment, but have Korean fonts installed, both Thai and Korean are rendered. The J2RE now also automatically detects physical fonts that are installed into its lib/fonts/fallback directory and adds these physical fonts to all logical fonts for 2D rendering.
AWT now uses the Unicode APIs on Windows 2000/XP. As a result, some of its components can handle text without being restricted by Windows locale settings. For example, AWT text components can accept and display text in the Devanagari writing system regardless of the Windows locale settings.
Java Sound Technology
Ports are now available on all platforms (RFE 4782900).
MIDI device i/o is now available on all platforms (RFE's 4812168, 4782924).
Optimized direct audio access is implemented on all platforms (RFEs 4908240 and 4908879). It is enabled by default on systems which offer native mixing (i.e. Linux ALSA with hardware mixing, Solaris Mixer enabled, Windows DirectSound).
The new real-time Sequencer works with all MIDI devices and allows unlimited Transmitters (RFE 4773012).
The sound.properties configuration file allows choice of default devices (RFE 4776511). For details, see MidiSystem and AudioSystem for details.
MidiDevices can query connected Receivers and Transmitters (RFE 4931387, methods MidiDevice.getReceiver and MidiDevice.getTransmitter).
AudioFormat, AudioFileFormat, and MidiFileFormat now have properties that allow further description and qualification of the format (RFEs 4925767 and 4666845).
A set of ease-of-use methods allow easier retrieval of lines from AudioSystem (RFE 4896221).
The Sequencer interface is extended with loop methods, for seamless looping of specific portions of a MIDI sequence (RFE 4204105).
Java Sound no longer prevents the VM from exiting (bug 4735740).
Java 2DTM Technology
Added 2D features include expanded Linux and Solaris printer support, new methods for creating fonts from files and streams, and new methods related to VolatileImages and hardware acceleration of images. A number of internal changes to text rendering code greatly improve its robustness, performance, and scalability. Other performance work includes hardware-accelerated rendering using OpenGL (disabled by default).
Image I/O
The Image I/O system now has readers and writers for BMP and WBMP formats.
AWT
Version 5.0 features many AWT enhancements and bug fixes, including some that have often been requested by our customers. Most notably, the new MouseInfo class makes it possible to determine the mouse location on the desktop. New Window methods make it possible to specify the default location for a newly created window (or frame), appropriate to the platform. Another Window enhancement makes it possible to ensure that a window (or frame) is always on top. (This feature does not work for some window managers on Solaris/Linux.) In the area of data transfer, the new DropTargetDragEvent API allows the drop target to access transfer data during the drag operation.
Swing
With the 1.4.2 release we provided two new look and feels for Swing: XP and GTK. Rather than taking a break, in 5.0 we're providing two more look and feels: Synth, a skinnable look and feel, and Ocean, a new theme for Metal. Beyond look and feels, we've added printing support to JTable, which makes it trivial to get a beautiful printed copy of a JTable. Lastly, after seven years, we've made jFrame.add equivalent to jFrame.getContentPane().add().