Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Java±à³Ì£ºÊµÀý·ÖÎöJ2MEÍøÂç±à³ÌµÄÁ½ÖÖ·½·¨


ºËÐÄÌáʾ£º±¾ÎÄÃèÊöÁËÔÚJ2meÖпª·¢Ö÷ҪʹÓõÄÍøÂçÁ¬½Ó·½·¨£¬·Ö±ðÏêϸ½éÉÜÁËʹÓÃhttpºÍsocketÁ½ÖÖ·½·¨¡£ HttpConnection Ê×ÏÈÎÒÃÇÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó°É£º Ö÷ÒªÓõ½µÄjava°ü£º javax.microedition.io.*; public String requestGET(String URLString,String URL) throws
±¾ÎÄÃèÊöÁËÔÚJ2meÖпª·¢Ö÷ҪʹÓõÄÍøÂçÁ¬½Ó·½·¨£¬·Ö±ðÏêϸ½éÉÜÁËʹÓÃhttpºÍsocketÁ½ÖÖ·½·¨¡£
 HttpConnection
 Ê×ÏÈÎÒÃÇÏÈÀ´¿´Ò»¸ö¼òµ¥µÄÀý×Ó°É£º
Ö÷ÒªÓõ½µÄjava°ü£º
 javax.microedition.io.*;
 public¡¡String¡¡requestGET(String¡¡URLString,String¡¡URL)¡¡throws¡¡IOException{
//¡¡=====================================
//¡¡URLStringÊÇHTTPµØÖ·£¬URLΪºóÃæµÄ²ÎÊý
//¡¡ÕâÀïµÄÀý×ÓÊÇ·¢ËÍÓõÄÓû§ÃûºÍÃÜÂëµ½·þÎñÆ÷¶Ë½øÐÐÓû§ÑéÖ¤
//¡¡±ÈÈç¡¡String¡¡URLString¡¡=¡¡"http://192.168.0.1:8080/login.jsp";
//¡¡String¡¡URL¡¡=¡¡"?Name="+this.txtName+"&Pass="+this.txtPass
//¡¡=====================================
HttpConnection¡¡hpc¡¡=¡¡null;
DataInputStream¡¡dis¡¡=¡¡null;
boolean¡¡newline¡¡=¡¡false;
String¡¡content¡¡=¡¡"";
try{
//¡¡=====================================
//¡¡½¨Á¢Á¬½Ó
//¡¡=====================================
hpc¡¡=¡¡(HttpConnection)Connector.open(URLString+URL);
hpc.setRequestMethod(HttpConnection.GET);
dis¡¡=new¡¡DataInputStream(hpc.openInputStream());
int¡¡character;
//¡¡=====================================
//¡¡¶ÁÈ¡·µ»ØµÄHTTPÄÚÈÝ
//¡¡====================================
while((character¡¡=¡¡dis.read())¡¡!=¡¡-1){
if((char)character¡¡==¡¡'\\'){
newline¡¡=¡¡true;
continue;
}
else{
if((char)character¡¡=='n'&&¡¡newline){
content¡¡+="\n";
newline¡¡=¡¡false;
}
else¡¡if(newline){
content¡¡+="\\"¡¡+(char)character;
newline¡¡=¡¡false;
}
else{
content¡¡+=(char)character;
newline¡¡=¡¡false;
}
}
}
}
catch(IOException¡¡e){
System.out.print("ERROR:"+e);
}
finally{
if(hpc¡¡!=¡¡null){
hpc.close();
hpc¡¡=¡¡null;
}
if(dis¡¡!=¡¡null){
dis.close();
}
}
//¡¡====================================
//¡¡ÓÉÓÚÄÚÈÝ¿ÉÄÜÓÐÖÐÎÄ£¬ËùÒÔÔÚ½ÓÊܵ½ÐÅÏ¢ºóÒª¶ÔÄÚÈݽøÐÐ×Ö·û¼¯µÄת»»
//¡¡====


Ïà¹ØÎĵµ£º

Java²¢·¢±à³Ì ÉÏ

Ò»¡¢Ïß³Ì
1 Ï̵߳Ĵ´½¨
´´½¨Ïß³Ìͨ³£ÓÐÁ½ÖÖ·½·¨: 1) À©Õ¹ThreadÀàʵÏÖÏ̵߳Ĵ´½¨ÊÇ×î³£ÓÃÒ²ÊÇ×îÖ±½ÓµÄÒ»ÖÖ·½·¨£¬Í¨¹ý¼Ì³ÐÀàThreadʵÏÖÏß³ÌÌ壻2) ͨ¹ýʵÏÖRunnable½Ó¿ÚʵÏÖÏß³ÌÌå¡£
2 ThreadÀàµÄ¼¸ÖÖ¹¹Ô캯Êý
    1) Thread()
    2) Thread(Runnable target)
    3) T ......

JAVA³£ÓòÙ×÷Óï¾ä ÏîÄ¿ÖеÄ×ܽá¶þ


jspÊä³ö¸ñʽ»¯ºóµÄÈÕÆÚ
<fmt:formatDate value="${whiteNumber.crtdate }" pattern="yyyy-MM-dd HH:mm:ss"/>
ÈçÊÇmodelÀïµÄlistÔÚactionÖÐÈ¡²»µ½Öµ¡£¿ÉÄÜÔÚ¸ÃmodelÖеÄlistµÄsetterºÍgetter·½Ê½ÖУ¬Ê¹ÓõĿÉÄÜÊÇlazy¼ÓÔØ£¬¸ÄΪEAGER¼´¿É¡£
<s:iterator>±êÇ©ÀﻹÓÐ<s:iterator>± ......

java ÊÂÎñÏÝÚå

ÕâƪÎÄ×ÖдµÄºÜºÃ£¬ÍƼö¸ø×Ô¼ººÍ´ó¼Ò£¡
ÊÂÎñ²ßÂÔ: Á˽âÊÂÎñÏÝÚå
ÔÚ Java ƽ̨ÖÐʵÏÖÊÂÎñʱҪעÒâµÄ³£¼û´íÎó
 
 
 
¼¶±ð£º Öм¶
Mark Richards, Ö÷¹ÜºÍ¸ß¼¶¼¼Êõ¼Ü¹¹Ê¦, Collaborative Consulting, LLC
2009 Äê 3 ÔÂ 06 ÈÕ
ÊÂÎñ´¦ÀíµÄÄ¿±êÓ¦¸ÃÊÇʵÏÖÊý¾ÝµÄ¸ß¶ÈÍêÕûÐÔºÍÒ»ÖÂÐÔ¡£±¾ÎÄÊÇΪ Java ƽ̨¿ª· ......

JAVA¼¼ÇÉ:´ò°üwarµÄ¼¸ÖÖ·½·¨

¡¡1.Ê×ÏÈÊǹ¤¾ß±ÈÈçEclipseºÜ·½±ãÁË¡£
¡¡¡¡2.ÓÃwinrarÖ®ÀàµÄ¹¤¾ß£¬°Ñweb-infoĿ¼£¬¼°¸úËüͬ¼¶µÄËùÓÐĿ¼¼°Îļþ£¬´ò°ü³É zipÎļþ¾ÍÐÐÁË£¬È»ºó°ÑÀ©Õ¹Ãû¸Ä³Éwar!
¡¡¡¡3 JarÃüÁ
¡¡¡¡¼Ù¶¨ÓÐÒ»¸öWebÓ¦ÓãºC:\myHome
¡¡¡¡ myHome/WEB-INF/……
¡¡¡¡myHome/files/……
¡¡¡¡myHome/image/… ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ