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

java(Web)ÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶ÎÊÌâ×ܽá

1.»ù±¾¸ÅÄîµÄÀí½â
¡¡¡¡¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:\xyz\test.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸ö
URL¾ø¶Ô·¾¶¡£
¡¡¡¡Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄÏà¶Ô·¾¶£¨HTMLÖеÄÏà¶ÔĿ¼£©£¬ÀýÈ磺ÔÚ
ServletÖУ¬"/"´ú±íWebÓ¦ÓõĸúĿ¼¡£ºÍÎïÀí·¾¶µÄÏà¶Ô±íʾ¡£ÀýÈ磺"./" ´ú±íµ±Ç°Ä¿Â¼,
"../"´ú±íÉϼ¶Ä¿Â¼¡£ÕâÖÖÀàËƵıíʾ£¬Ò²ÊÇÊôÓÚÏà¶Ô·¾¶¡£
ÁíÍâ¹ØÓÚURI£¬URL,URNµÈÄÚÈÝ£¬Çë²Î¿¼RFCÏà¹ØÎĵµ±ê×¼¡£
RFC 2396: Uniform Resource Identifiers (URI): Generic Syntax, 
(http://www.ietf.org/rfc/rfc2396.txt)
2.¹ØÓÚJSP/ServletÖеÄÏà¶Ô·¾¶ºÍ¾ø¶Ô·¾¶¡£
2.1·þÎñÆ÷¶ËµÄµØÖ·
¡¡¡¡ ·þÎñÆ÷¶ËµÄÏà¶ÔµØÖ·Ö¸µÄÊÇÏà¶ÔÓÚÄãµÄwebÓ¦ÓõĵØÖ·£¬Õâ¸öµØÖ·ÊÇÔÚ·þÎñÆ÷¶Ë½âÎöµÄ
£¨²»Í¬ÓÚhtmlºÍJavascriptÖеÄÏà¶ÔµØÖ·£¬ËûÃÇÊÇÓÉ¿Í»§¶Ëä¯ÀÀÆ÷½âÎöµÄ£©Ò²¾ÍÊÇ˵Õâʱºò
ÔÚjspºÍservletÖеÄÏà¶ÔµØÖ·Ó¦¸ÃÊÇÏà¶ÔÓÚÄãµÄwebÓ¦Ó㬼´Ïà¶ÔÓÚhttp://192.168.0.1/webapp/µÄ¡£
¡¡¡¡ÆäÓõ½µÄµØ·½ÓУº 
 forward£ºservletÖеÄrequest.getRequestDispatcher(address);Õâ¸öaddressÊÇ
ÔÚ·þÎñÆ÷¶Ë½âÎöµÄ£¬ËùÒÔ£¬ÄãÒªforwardµ½a.jspÓ¦¸ÃÕâôд£º
request.getRequestDispatcher(“/user/a.jsp”)Õâ¸ö/Ïà¶ÔÓÚµ±Ç°µÄwebÓ¦ÓÃwebapp£¬
Æä¾ø¶ÔµØÖ·¾ÍÊÇ£ºhttp://192.168.0.1/webapp/user/a.jsp¡£ 
sendRedirect£ºÔÚjspÖÐ<%response.sendRedirect("/rtccp/user/a.jsp");%>
2.22¡¢¿Í»§¶ËµÄµØÖ· 
 
       ËùÓеÄhtmlÒ³ÃæÖеÄÏà¶ÔµØÖ·¶¼ÊÇÏà¶ÔÓÚ·þÎñÆ÷¸ùĿ¼(http://192.168.0.1/)µÄ£¬
¶ø²»ÊÇ(¸úĿ¼ÏµĸÃWebÓ¦ÓõÄĿ¼)http://192.168.0.1/webapp/µÄ¡£ 
 HtmlÖеÄform±íµ¥µÄactionÊôÐԵĵØÖ·Ó¦¸ÃÊÇÏà¶ÔÓÚ·þÎñÆ÷¸ùĿ¼(http://192.168.0.1/)µÄ£¬
ËùÒÔ£¬Èç¹ûÌá½»µ½a.jspΪ£ºaction£½"/webapp/user/a.jsp"»òaction="<%=request.getContextPath()%>"/user/a.jsp£»
¡¡¡¡Ìá½»µ½servletΪactiom£½"/webapp/handleservlet"  
 ¡¡¡¡JavascriptÒ²ÊÇÔÚ¿Í»§¶Ë½âÎöµÄ£¬ËùÒÔÆäÏà¶Ô·¾¶ºÍform±íµ¥Ò»Ñù¡£
¡¡¡¡Òò´Ë£¬Ò»°ãÇé¿öÏ£¬ÔÚJSP/HTMLÒ³ÃæµÈÒýÓõÄCSS,Javascript.ActionµÈÊôÐÔÇ°Ãæ×îºÃ¶¼¼ÓÉÏ
<%=request.getContextPath()%>,ÒÔÈ·±£ËùÒýÓÃ


Ïà¹ØÎĵµ£º

Java±¨±íÈí¼þ±È½Ï

      ÎÄÕÂת×Ô£º±ÈÌØÍø
      ±¾ÎÄÁ´½Ó£ºhttp://news.chinabyte.com/303/9117803.shtml
      Java±¨±íÈí¼þÓ¦ÓÃÔÚjavaÓ¦ÓÃÏîÄ¿ÖУ¬ÄÜǶÈëʽµÄ½«java±¨±í¹¤¾ß²¿Êðµ½javaÓ¦ÓÃÖУ¬Äܹ²ÏíÓ¦Ó÷þÎñÆ÷Á¬½Ó³Ø£¬ÀûÓÃÓ¦Ó÷þÎñ¸ºÔð¾ùºâºÍ¼¯ÈºÌØÐÔ¡£Òò ......

JAVA ¿ì½Ý¼ü

¿´ÁËjava˽ÛÓµÄÖм¶ÊÓƵ£¬¸Ð¾õºÜÈ«Ã棬×ܽáÕûÀí³öÁËһЩEclipse¿ì½Ý¼ü£¬Ï£Íû¶ÔÓÐÓõÄÅóÓÑÓÐËù°ïÖú£º
Ctrl+1 ¿ìËÙÐÞ¸´(×î¾­µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(Ìرðʵ ......

JAVAÅàѵÌâ¿â AJAX

1.AJAX»ù´¡ÖªÊ¶_Ñ¡ÔñÌâ
1. AjaxÓÐËÄÖÖ¼¼Êõ×é³É£ºDOM,CSS,JavaScript£¬XmlHttpRequestÖпØÖÆÎĵµ½á¹¹µÄÊÇ£º£¨ £©
A  DOM
B  CSS
C  javascript   
D  XMLHttpRequest
²Î¿¼´ð°¸£ºA
2. ÔÚAjaxµÄËÄÖÖ¼¼ÊõÖУ¬¿ØÖÆͨÐŵÄÊÇÄÄÒ»¸ö£¿£¨ £©
A  DOM
B  CSS
C  javasc ......

ʹÓÃJavaÔÚÎļþÀï²åÈëÒ»ÐÐ

ÔÚÎļþÀïÔö¼ÓÒ»ÐеÄΨһ·½·¨¾ÍÊǶÁȡԭʼÎļþ£¬È»ºóдÈëµ½Ò»¸öÁÙʱÎļþ£¬Í¬Ê±Ð´ÈëÒª²åÈëµÄÊý¾Ý¡£È»ºóɾ³ýԭʼÎļþ£¬ÔÙ°ÑÁÙʱÎļþ¸ÄÃûΪԭʼÎļþÃû¡£
package net.java2000.io; 
 
import java.io.BufferedReader; 
import java.io.File; 
import java.io.FileInputStream; 
import jav ......

ÈÏʶjavaÖеÄÔËÐÐʱÒì³£

JavaÖÐÒì³£Ò»°ã·ÖΪ3À࣬ϱ߽éÉÜÏ£¬½ö½öÊǸöÈËÀí½â¡£
µÚÒ»ÖÖÊDZàÒëÆÚÒì³££¬»òÕß½Ðcheck Exception¡£
±àÒëÆÚÒì³£µÄÌص㣺
1.ϵͳҪÇó±ØÐëÔÚ³ÌÐòÀï×ö³ö´¦Àí£¬·ñÔò±¨±àÒë´íÎ󣬱àÒëÎÞ·¨Í¨¹ý£¬Ò²¾ÍÊÇ˵ϵͳǿÖÆÒªÇó´¦Àí£¬¶ÔÓÚ´¦Àí·½Ê½£¬²»ÍâºõÖ±½Ócatch´¦ÀíºÍÅ׳öµ½Íâ²ã£¬µ«ÊÇ×îÖÕ»¹ÊÇÒª´¦ÀíµÄ¡£
2.Óû§×Ô¶¨ÒåÒ»¸ö±àÒëÆÚÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ