JavaÏà¶Ô·¾¶×ܽá
1.»ù±¾¸ÅÄîµÄÀí½â
¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:xyz est.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()%>,ÒÔÈ·±£ËùÒýÓõÄÎļþ¶¼ÊôÓÚWebÓ¦ÓÃÖеÄĿ¼¡£ÁíÍ⣬Ӧ¸Ã¾¡Á¿±ÜÃâʹÓÃÀàËÆ&qu
Ïà¹ØÎĵµ£º
Javaѧϰ´ÓÈëÃŵ½¾«Í¨
Ò»¡¢ JDK (Java Development Kit)
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......
תÖÁ£ºhttp://sllereak.blog.163.com/blog
--ÃæÏò¶ÔÏóºÍÃæÏò¹ý³Ì
* ÃæÏò¹ý³Ì£º ÊÖ°ÑÊֵĽÌËû£»Á˽âËùÓеÄÒµÎñÁ÷³Ì¡£
* ÃæÏò¶ÔÏó£º ¸æËßËûÈ¥¸ÉʲôÊ£¬±ðµÄ²»ÓòÙÐÄ£»ÒòΪËû×Ô¼ºÁ˽â×Ô¼ºµÄÄÚ²¿½á¹¹£»
* ËùÒÔÃæÏò¹ý³ÌµÄ±à³ÌÊÇ¿¼ÂÇÊÇÔõÑ ......
ÕâÀïµÄ˵µÄjava¿ª·¢»·¾³£¬ÒԴeclipse3.2.1ΪÖ÷Ìâ.
¡¡¡¡1¡¢°²×°ºÃUbuntuϵͳ;°²×°µÄʱºòÇ¿ÁÒ½¨ÒéÁ¬½ÓÉÏÍø£¬Ëü»á×Ô¶¯ÏÂÔØÓïÑÔ°ü£¬×Ô¶¯×°ÉÏÎå±Ê£¬Æ´Òô£¬»¹ÓлáĬÈÏ°Ñfirefoxä¯ÀÀÆ÷ÉèÖÃΪÖÐÎÄ.
¡¡¡¡°²×°Ubuntu±Èwindowsϵͳһ¸ö±È½ÏˬµØ·½¾ÍÊÇ°²×°¿ÉÒÔÒ»±ßÉÏÍøä¯ÀÀ,»¹¿ÉÒÔÊÔÓÃÒ»ÏÂUbuntuµÄ¹¦ÄÜ¡£
¡¡¡¡2¡¢ÅäÖÃUbuntu»·¾³£º ......
Ò»°ã½ø¶ÈÌõʹÓÃÊǸøÓû§Ò»ÖÖÓѺÃÌáʾ£¬ÈÃÓû§¸Ð¾õÕâ¸öÊÂÇéÕýÔÚ×ö£¬¶ø²»ÊÇϵͳûÓз´Ó¦ÁË£»
JProgressBarµÄ´úÂëÎĵµ´ó¼Ò¿ÉÒԲο¼JDK1.6£¬±ÈÈç¹¹Ô캯ÊýÓÐÄÄЩ£¬³£Óõķ½·¨ÓÐÄÄЩÔڴ˾Ͳ»¶àÐðÊö£»
Ò»°ãʹÓÃÇé¿öÊÇ£¬µã»÷°´Å¥ÊÇ×öÒ»¼þÊÂÇ飬±ÈÈ籸·Ý£¬½ø¶ÈÌõ³öÏÖ²¢Ôö¼Ó½ø¶È±íʾÕýÔÚ½øÐлòµ½Ê²Ã´³Ì¶È£¬ÊÂÇé½áÊøʱ£¬½ø¶ÈÌõÏÔʾÂú ......