Java SE 6 ÐÂÌØÐÔ: ¶Ô½Å±¾ÓïÑÔµÄÖ§³Ö
Java ½Å±¾ API ¸ÅÊö
½Å±¾ÒýÇæ
½Å±¾ÒýÇæ¾ÍÊÇÖ¸½Å±¾µÄÔËÐл·¾³£¬ËüÄÜÄܹ»°ÑÔËÐÐÆäÉϵĽâÊÍÐÔÓïÑÔת»»Îª¸üµ×²ãµÄ»ã±àÓïÑÔ£¬Ã»Óнű¾ÒýÇæ£¬½Å±¾¾ÍÎÞ·¨±»ÔËÐС£
Java SE 6 ÒýÈëÁË¶Ô Java Specification Request£¨JSR£©223 µÄÖ§³Ö£¬JSR 223 Ö¼ÔÚ¶¨ÒåÒ»¸öͳһµÄ¹æ·¶£¬Ê¹µÃ Java Ó¦ÓóÌÐò¿ÉÒÔͨ¹ýÒ»Ì׹̶¨µÄ½Ó¿ÚÓë¸÷Öֽű¾ÒýÇæ½»»¥£¬´Ó¶ø´ïµ½ÔÚ Java ƽ̨Éϵ÷Óø÷Öֽű¾ÓïÑÔµÄÄ¿µÄ¡£javax.script °ü¶¨ÒåÁËÕâЩ½Ó¿Ú£¬¼´ Java ½Å±¾±à³Ì API¡£Java ½Å±¾ API µÄÄ¿±êÓë Apache ÏîÄ¿ Bean Script Framework£¨BSF£©ÀàËÆ£¬Í¨¹ýËü Java Ó¦ÓóÌÐò¾ÍÄÜͨ¹ýÐéÄâ»úµ÷Óø÷Öֽű¾£¬Í¬Ê±£¬½Å±¾ÓïÑÔÒ²ÄÜ·ÃÎÊÓ¦ÓóÌÐòÖÐµÄ Java ¶ÔÏóºÍ·½·¨¡£Java ½Å±¾ API ÊÇÁ¬Í¨ Java ƽ̨ºÍ½Å±¾ÓïÑÔµÄÇÅÁº¡£Ê×ÏÈ£¬Í¨¹ýËüΪÊýÖÚ¶àµÄÏÖÓÐ Java ¿â¾ÍÄܱ»¸÷Öֽű¾ÓïÑÔËùÀûÓ㬽ÚÊ¡ÁË¿ª·¢³É±¾Ëõ¶ÌÁË¿ª·¢ÖÜÆÚ£»Æä´Î£¬¿ÉÒÔ°ÑһЩ¸´ÔÓÒì±äµÄÒµÎñÂß¼½»¸ø½Å±¾ÓïÑÔ´¦Àí£¬ÕâÓÖ´ó´óÌá¸ßÁË¿ª·¢Ð§ÂÊ¡£
ÔÚ javax.script °üÖж¨ÒåµÄʵÏÖÀಢ²»¶à£¬Ö÷ÒªÊÇһЩ½Ó¿ÚºÍ¶ÔÓ¦µÄ³éÏóÀ࣬ͼ 1 ÏÔʾÁËÆäÖаüº¬µÄ¸÷¸ö½Ó¿ÚºÍÀà¡£
ͼ 1. javax.script °ü¸Å¿ö
Õâ ¸ö°üµÄ¾ßÌåʵÏÖÀàÉٵĸù±¾ÔÒòÊÇÕâ¸ö°üÖ»ÊǶ¨ÒåÁËÒ»¸ö±à³Ì½Ó¿ÚµÄ¿ò¼Ü¹æ·¶£¬ÖÁÓÚ¶ÔÈçºÎ½âÎöÔËÐоßÌåµÄ½Å±¾ÓïÑÔ£¬»¹ÐèÒªÓɵÚÈý·½ÌṩʵÏÖ¡£ËäÈ»ÕâЩ½Å±¾ÒýÇæ µÄʵÏÖ¸÷²»Ïàͬ£¬µ«ÊǶÔÓÚ Java ½Å±¾ API µÄʹÓÃÕßÀ´Ëµ£¬ÕâЩ¾ßÌåµÄʵÏÖ±»ºÜºÃµÄ¸ôÀëÒþ²ØÁË¡£Java ½Å±¾ API Ϊ¿ª·¢ÕßÌṩÁËÈçϹ¦ÄÜ£º
»ñÈ¡½Å±¾³ÌÐòÊäÈ룬ͨ¹ý½Å±¾ÒýÇæÔËÐнű¾²¢·µ»ØÔËÐнá¹û£¬ÕâÊÇ×îºËÐĵĽӿڡ£
·¢Ïֽű¾ÒýÇæ£¬²éѯ½Å±¾ÒýÇæÐÅÏ¢¡£
ͨ¹ý½Å±¾ÒýÇæµÄÔËÐÐÉÏÏÂÎÄÔڽű¾ºÍ Java ƽ̨¼ä½»»»Êý¾Ý¡£
ͨ¹ý Java Ó¦ÓóÌÐòµ÷Óýű¾º¯Êý¡£
ÔÚÏêϸ½éÉÜÕâËĸö¹¦ÄÜ֮ǰ£¬ÎÒÃÇÏÈͨ¹ýÒ»¸ö¼òµ¥µÄÀý×ÓÀ´Õ¹Ê¾ÈçºÎͨ¹ý Java ÓïÑÔÀ´ÔËÐнű¾³ÌÐò£¬ÕâÀïÈÔÈ»ÒÔ¾µäµÄ“Hello World”¿ªÊ¼¡£
Çåµ¥ 1. Hello World
import javax.script.*;
public class HelloWorld {
public static void main(String[] args) throws ScriptException {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = mana
Ïà¹ØÎĵµ£º
ÊäÈëÍøÒ³ÎļþÃû£¬ºÍ×ÊÔ´ÁбíÎļþÃû
Êä³ö×ÊÔ´ÁбíÎļþ¹©Ñ¸À×ÏÂÔØ¡£
ÊÊÓÃÓÚÅúÁ¿ÏÂÔØÍ¼Æ¬¡£
ÓÉÁ½¸öÎļþ×é³É¡£
ûÓÐÌá¹©ÍøÒ³ÏÂÔØ¹¦ÄÜ£¬ÒòΪÎÒûÓÐʱ¼äд£¬Ïà¹ØµÄ´úÂëÒÔºóÔÙÌù¡£
1
//
AnalizeIMG.java
2
3
//
Ö÷³ÌÐò
4
5
import
java.io.BufferedReader;
6
import
......
http://www.andykhan.com/jexcelapi/¿ÉÒÔÏÂÔØµ½µÚÈý·½jxl.jar°ü£¬²¢ÇÒexcelÒª±£´æÎª2003»òÒÔǰµÄ°æ±¾
package com.excel;
// 1 Îļþ¶ÔÏó 2¹¤×÷²¾¶ÔÏó 3 µ¥Ôª¸ñ¶ÔÏó¡£
//ÏàÓ¦µÄÔÚJXLÖоÍÓÐWorkbook£¬Sheet £¬Cell ¡£
import java.io.*;
import jxl.*;
public class GetExcelValues3 {
public static void main(Strin ......
1. ´´½¨Ị̈߳¨¼Ì³ÐThreadºÍʵÏÖrunnable½Ó¿Ú£© class SubThread {
private class InnerThread extends Thread {
@Override
public void run() {
System.out.println(Thread.currentThread().getName());
super.run();
}
}
public Thread getThread() {
return new InnerThread();
}
}
......
¼òÑÔÖ®,Èç¹û²»ÓõÚÈý·½ÌṩµÄ½Ó¿Ú
ÄÇ×îºÃµÄ½â¾ö·½°¸Ó¦¸ÃÊǵ±SESSION½¨Á¢Ê±sessionCreated(),ÔÚ·ÃÎÊ×ÜÊýºÍµ±Ç°ÔÚÏßÈËÊýÉÏ+1
µ±SESSIONÏú»ÙʱsessionDistroyed(),ÔÚÏßÈËÊý-1
ºËÐÄ·½·¨ÊÇÀûÓÃListener¼àÌýµÄ¸÷ÖÖ½Ó¿Ú
ÎÒ°Ñ´úÂë(Ö÷Òª²¿·Ö)ÌùÔÚÏÂÃæ
´Ë¶Î´úÂëÎÒÇ××ÔʹÓùý,ûÓÐÎÊÌâ
µ«ÒòΪ¼Ì³ÐÁ˽ӿÚ,ÓÐЩδʹÓõķ½·¨Ò²Òª² ......