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

´«ÖDz¥¿Íjavaѧϰ ÎļþµÄÉÏ´«ÏÂÔØ

½ñÌìÎÒѧϰÁËÎļþÉÏ´«¡¢ÏÂÔØ֪ʶ£¬ÊÇ·ëÀÏʦ½²µÄ¿Î£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
Ò»¡¢ÎļþÉÏ´«Ê±£¬ÒªÔÚÒ³ÃæÉèÖãº±íµ¥ÔªËØ<input type=“file” />£¬ÐèÒªÖ¸¶¨±íµ¥ enctype µÄֵΪ multipart/form-data
¶þ¡¢          Commons-fileupload ×é¼þÉÏ´«µÄ»ù±¾Ô­Àí £º
a)         FileUpload×é¼þ½«Ò³ÃæÌá½»µÄËùÓÐÔªËØ(ÆÕͨform±íµ¥Óò£¬ÈçtextºÍÎļþÓòfile)¶¼¿´×÷Ò»ÑùµÄFileItem£¬ÕâÑùÉÏ´«Ò³ÃæÌá½»µÄ requestÇëÇóÒ²¾ÍÊÇÒ»¸öFileItemµÄÓÐÐò×éºÏ£¬FileUpload×é¼þ¿ÉÒÔ½âÎö¸Ãrequest£¬²¢·µ»ØÒ»¸öÒ»¸öµÄFileItem¡£¶ø¶Ôÿһ¸öFileItem£¬FileUpload×é¼þ¿ÉÒÔÅжϳöËüÊÇÆÕͨform±íµ¥Óò»¹ÊÇÎļþfileÓò£¬´Ó¶ø¸ù¾Ý²»Í¬µÄÀàÐÍ£¬²ÉÈ¡²»Í¬µÄ²Ù×÷£­£­Èç¹ûÊÇ±íµ¥Óò£¬¾Í¶Á³öÆäÖµ£¬Èç¹ûÊÇÎļþÓò£¬¾Í±£´æÎļþµ½·þÎñÆ÷Ó²ÅÌÉÏ»òÕßÄÚ´æÖС£
Èý¡¢Commons-fileupload ×é¼þAPI£º
a)         ÔÚ Commons-fileupload ×é¼þÖУ¬Ö÷ÒªÓõ½ÒÔÏÂÈý¸ö½Ó¿ÚºÍÀࣺ
b)            org.apache.commons.fileupload.FileItem;
c)            org.apache.commons.fileupload.disk.DiskFileItemFactory;
d)            org.apache.commons.fileupload.servlet.ServletFileUpload
e)         ServletFileUpload ¸ºÔð´¦ÀíÉÏ´«µÄÎļþÊý¾Ý£¬²¢½«Ã¿²¿·ÖµÄÊý¾Ý·â×°µ½ FileItem ¶ÔÏóÖС£
f)         DiskFileItemFactory ÊÇ´´½¨ FileItem ¶ÔÏóµÄ¹¤³§£¬ÔÚÕâ¸ö¹¤³§ÀàÖпÉÒÔÅäÖÃÄڴ滺³åÇø´óСºÍ´æ·ÅÁÙʱÎļþµÄĿ¼¡£
g)        ServletFileUpload ÔÚ½ÓÊÕÉÏ´«ÎļþÊý¾Ýʱ£¬»á½«ÄÚÈݱ£´æµ½Äڴ滺´æÇøÖУ¬Èç¹ûÎļþÄÚÈݳ¬¹ýÁË DiskFileItemFactory Ö¸¶¨µÄ»º³åÇøµÄ´óС£¬ÄÇôÎļþ½«±»±£´æµ½´ÅÅÌÉÏ£¬´æ´¢Îª DiskFileItemFactory Ö¸¶¨Ä¿Â¼ÖеÄÁÙʱÎļþ¡£µÈÎļþÊý¾Ý¶¼½ÓÊÕÍê±Ïºó£¬ServletUpload ÔÚ´ÓÎļþÖн«Êý¾ÝдÈëµ½ÉÏ´«ÎļþĿ¼ÏµÄÎļþÖÐ
ËÄ¡¢ÎļþµÄÏÂÔØ£ºÒ»°ãÓÐÁ½ÖÖ·½Ê½£º
a)         1.Ö±½ÓÓó¬Á´½ÓµÄ·½Ê½£¬Á¬½Óµ½·þÎñ


Ïà¹ØÎĵµ£º

javaÒþ²Øʵʩ¹ý³Ì

1   package ºÍ importµÄ×÷ÓÃÊÇ·Ö¸îÈ«¾ÖÃüÃû¿Õ¼ä£¬±£Ö¤ÎÒÃDz»»áÓöµ½Ãû×ֵijåÍ»¡£
2 java½âÊÍÆ÷µÄ¹¤×÷³ÌÐò£º
 £¨1£© Ê×ÏÈËüÕÒµ½»·¾³±äÁ¿CLASSPATH £¬ CLASSPATH°üº¬Ò»¸ö»ò¶à¸öĿ¼£¬ËüÃÇ×÷Ϊһ¸öÌØÊâµÄ¸ùʹÓ㬴ÓÕâÀïÕ¹¿ª¶Ô.classÎļþµÄËÑË÷£¬
  ´ÓÄǸö¸ù¿ªÊ¼£¬½âÊÍÆ÷»áÑ°ÕÒ°üÃû£¬²¢½«ËüÃÇÿһ¸öµãºÅ ......

javaÉÏËÝ

JAVAÊÇÇ¿ÀàÐ͵ÄÓïÑÔ¡£µ±ÒýÓöÔÏóµÄʱºò£¬Èç¹ûÊÇÉÏËݵĻ°£¬ÐèҪǿÖÆת»»¡£ÈçÄãÉÏÃæдµÄ£¬
PiePlot p = (PiePlot)Plot£¬Õâ¾ÍÊÇÉÏËÝ£¬Éú³ÉʵÀýʱÒýÓõÄÊǸ¸À࣬ÐèҪǿÖÆת»»£¬ËùÒÔ¾ÍÐèÒª¼Ó¸ö£¨PiePlot£©À´ÉùÃ÷Plot£¨PlotÊǸ¸Àࣩ¡£ ......

Effective Java ѧϰ±Ê¼Ç (7)

Finalizer ²»¿É¼Æ»®µÄ,Ò²ÊÇΣÏÕµÄ,Ò»°ãÒ²ÊDz»±ØÒªµÄ. ²»ÄÜÔÚfinalizerÖзÅÈκÎÓëÒÀÀµÊ±¼äÏà¹ØµÄ²Ù×÷,ÒòΪÄã²»ÖªµÀËüʲôʱºò±»Ö´ÐÐ. ±ÈÈçÔÚfinalizerÖйرÕÎļþµÄ×ö·¨¾ÍÊÇ´íÎóµÄ, ¸ù¾ÝJVMµÄʵÏÖ·½Ê½²»Í¬,ÓпÉÄܵ¼Ö´ò¿ªµÄÎļþÊý¹ý¶à¶øÎÞ·¨ÔÙ´ò¿ªÎļþ. Ò²²»ÄÜÔÚfinalizerÖиıä״̬,Èç¸øÊý¾Ý¿â½âËøµÈ. finalizer»¹ÄÜ´øÀ´Ñ ......

´«ÖDz¥¿Íjavaѧϰ jdbc½ø½×

1.PreparedStatementÓëstatement±È½Ï
 *°²È«ÐÔ£ºPreparedStatement°²È«£¬statement²»°²È«
 *ÅúÁ¿Óï¾äµÄÖ´ÐУºPreparedStatementÖ´ÐÐЧÂʸߣ¬statementÖ´ÐÐЧÂʵͣ¬
 *µ¥ÌõÓï¾äµÄÖ´ÐУºPreparedStatementÖ´ÐÐЧÂʵͣ¬statementÖ´ÐÐЧÂʸߣ¬
**********************************
 ´úÂëµÄ¿É¶ÁÐԺͿÉÎ ......

´«ÖDz¥¿Íjavaѧϰ Servlet¼àÌýÆ÷listener

½ñÌìÎÒѧϰÁËjavaweb µÄ¼àÌýÆ÷µÄ֪ʶ£¬ÊÇ·ëÀÏʦ½²µÄ¿Î£¬ÎÒ×öÁ˼òµ¥µÄ±Ê¼Ç£º
 
Servlet¼àÌýÆ÷listener£º
Ò»¡¢         ´´½¨£¨servletcontext£©ÉÏÏÂÎļàÌý£º
a)       ¶¨ÒåÒ»¸öÀ࣬ʵÏÖServletContextListener½Ó¿Ú£¬ÔÚweb.xmlÀïÃæ×¢²á¼àÌý£¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ