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

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() Îļ


Ïà¹ØÎĵµ£º

java·½·¨´«ÖµºÍ´«ÒýÓÃ

ij֪ÃûÃÅ»§ÍøÕ¾µÄÒ»µÀ±ÊÊÔÌâ
public class Test {
public static void stringUpd(String str) {
str = str.replace("j", "l");
System.out.println(str);
}

public static void stringBufferUpd(StringBuffer bf) {
bf.append("c");
System.out.println(bf);
}

......

Java Observer Pattern

²é¿´×îо«»ªÎÄÕ Çë·ÃÎʲ©¿ÍÊ×Ò³Ïà¹ØÎÄÕ ͨÓøßУÅÅ¿ÎËã·¨Ñо¿----Ç°ÑÔjava cloneÏê½âÈ«ÃæÉîÈë½éÉÜC++×Ö·û´®£ºstringÀàÔƼÆËãµ¼ÂÛFreeMarker±Ê¼Ç²ÔÓ¥-GISRenÂþ»°GISÁÖÊÏÎïÓï.³¯»¨Ï¦Ê°Ö®ºÞ·êÇäÍíÎ人¾¹Éý¹«Ë¾ WebSphere Portal ÄÚÈݹÜÀíÉý¼¶ÊµÊ©·½°¸ ......

ZlibѹËõËã·¨ÔÚjavaÉϵÄÓ¦ÓÃ

JAVAʵÏÖ
¡¡¡¡ÔÚJDKÖУ¬ÔÚjava.util.zip°üÖÐÒѾ­ÄÚÖÃÁËZLIBµÄʵÏÖ£¬Ê¾Àý´úÂëÈçÏ£º
1//½âѹ
2 public String decompressData(String encdata) {
3 try {
4 ByteArrayOutputStream bos = new ByteArrayOutputStream(); 
5 InflaterOutputStream zos = new InflaterOutputStream(bos); 
6 zo ......

´Ó Java ´úÂëÄæÏò¹¤³ÌÉú³É UML ÀàͼºÍÐòÁÐͼ

±¾ÎÄÃæÏòÓÚÄÇЩÈí¼þ¼Ü¹¹Ê¦£¬Éè¼ÆʦºÍ¿ª·¢ÈËÔ±£¬ËûÃÇÏëʹÓà IBM® Rational® Software Architect ´Ó Java™ Ô´´úÂëÀ´ÄæÏò¹¤³ÌÉú³É UML ÀàºÍÐòÁÐͼ¡£ ÄæÏò¹¤³Ì¾­³£±»ÓÃÀ´´ÓÒÑÓеÄÔ´´úÂëÖÐÒÔÒ»ÖÖ³éÏóÄ£ÐÍ UML ¸ñʽÀ´»ñµÃ¶ªÊ§µÄÉè¼ÆÎĵµ£¬Æä¿ÉÒÔÓÃÀ´Ñо¿Ò»¸öϵͳµÄ¾²Ì¬½á¹¹ºÍ¶¯Ì¬ÐÐΪ£¬²¢ÓÃÓÚÀ©Õ¹ÐµÄÌØÐÔµ½²úÆ·¡£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ