JavaÖÐÏà¶Ô·¾¶£¬¾ø¶Ô·¾¶ÎÊÌâ×ܽá
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ÖÐ
2.2¡¢¿Í»§¶ËµÄµØÖ· ËùÓеÄ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=""/user/a.jsp;
Ìá½»µ½servletΪactiom="/webapp/handleservlet"
JavascriptÒ²ÊÇÔÚ¿Í»§¶Ë½âÎöµÄ£¬ËùÒÔÆäÏà¶Ô·¾¶ºÍform±íµ¥Ò»Ñù¡£
Òò´Ë£¬Ò»°ãÇé¿öÏ£¬ÔÚJSP/HTMLÒ³ÃæµÈÒýÓõÄCSS,Javascript.ActionµÈÊôÐÔÇ°Ãæ×îºÃ¶¼¼ÓÉÏ ,ÒÔÈ·±£ËùÒýÓõÄÎļþ¶¼ÊôÓÚWebÓ¦ÓÃÖеÄĿ¼¡£ ÁíÍ⣬Ӧ¸Ã¾¡Á¿±ÜÃâʹÓÃÀàËÆ".","./","../../"µÈÀàËƵÄÏà¶Ô¸ÃÎļþλÖõÄÏà¶Ô·¾¶£¬ÕâÑù µ±ÎļþÒƶ¯Ê±£¬ºÜÈÝÒ׳öÎÊÌâ¡£
3. JSP/ServletÖлñµÃµ±Ç°Ó¦ÓõÄÏà¶Ô·¾¶ºÍ¾ø¶Ô·¾¶
3.1 JSPÖлñµÃµ±Ç°Ó¦ÓõÄÏà¶Ô·¾¶ºÍ¾ø¶Ô·¾¶ ¸ùĿ¼Ëù¶ÔÓ¦µÄ¾ø¶Ô·¾¶:request.getRequestURI() Îļ
Ïà¹ØÎĵµ£º
xmlÎļþÈçÏ ÅäÖù¦ÄÜ¿ª¹Ø
<Configurations>
<Samples>true</Samples>
<Excepts>true</Excepts>
<CheckFace>false</CheckFace>
<ThumbNail>false</ThumbNail>
&nbs ......
Java
»ù´¡·½Ãæ
:
1
¡¢
char
ÐͱäÁ¿ÖÐÄܲ»ÄÜ´æÖüÒ»¸öÖÐÎĺº×Ö
?
Ϊʲô
?
´ð£º
ÊÇÄܹ»¶¨Òå³ÉΪһ¸öÖÐÎĵģ¬ÒòΪjavaÖÐÒÔunicode±àÂ룬һ¸öcharÕ¼16×Ö½Ú£¬ËùÒÔ·ÅÒ»¸öÖÐÎÄÊÇûÎÊÌâµÄ
2:
À¬»ø»ØÊÕ»úÖÆ
,
ÈçºÎÓÅ»¯³ÌÐò
?
A:javaÖеÄÀ¬»øÊÕ¼¯
£¨Garbage Collection,GC£©ÓÃÀ´»ØÊÕÄÇЩ¹ýÈ¥·ÖÅäµÄ²»ÔÙÓ ......
JAVA ´úÂëÈçÏ£º
<%
// µÃµ½Òª×ª»»µÄÊý×é---µ±È»ÕâÀïÒ²¿ÉÒÔÊÇÆäËûÀàÐ͵ÄÊý×é
List jsList = (List) request.getAttribute("gczbh");
%>
JS ´úÂëÈçÏ£º
<script type="text/javascrip ......
±¾ÎÄÃæÏòÓÚÄÇЩÈí¼þ¼Ü¹¹Ê¦£¬Éè¼ÆʦºÍ¿ª·¢ÈËÔ±£¬ËûÃÇÏëʹÓà IBM® Rational® Software Architect ´Ó Java™ Ô´´úÂëÀ´ÄæÏò¹¤³ÌÉú³É UML ÀàºÍÐòÁÐͼ¡£ ÄæÏò¹¤³Ì¾³£±»ÓÃÀ´´ÓÒÑÓеÄÔ´´úÂëÖÐÒÔÒ»ÖÖ³éÏóÄ£ÐÍ UML ¸ñʽÀ´»ñµÃ¶ªÊ§µÄÉè¼ÆÎĵµ£¬Æä¿ÉÒÔÓÃÀ´Ñо¿Ò»¸öϵͳµÄ¾²Ì¬½á¹¹ºÍ¶¯Ì¬ÐÐΪ£¬²¢ÓÃÓÚÀ©Õ¹ÐµÄÌØÐÔµ½²úÆ·¡£ ......