´«ÖDz¥¿ÍJAVAÅàѵ2010 5 25
´«ÖDz¥¿ÍJAVAÅàѵ2010-5-25
×î½ü×Ô¼ºµÄѹÁ¦Ì«¶àÁË£¬ËäÈ»ÏÖÔÚÀë±ÏÒµÖ»ÓÐÒ»¸öÔÂÖ®¾ÃÁË£¬µ«ÊÇÏÖÔÚ×Ô¼º¶ÔÕâ¸öÏîÄ¿µÄÀí½âÈ´ÊÇÄÇôµÄµÍ¼¶£¬µ±Ã¿¸öÈËÃæÁÙÕâÑùµÄʱºòÊDz»ÊǶ¼»áºÍÎÒÒ»ÑùÓÐÕâÑùµÄ¹ËÂÇ£¬µ«ÊÇÊÇÈ˶¼ÓÖÖªµÀ£¬Ö»ÓÐͨ¹ýŬÁ¦ÈÃ×Ô¼ºµÄʵÁ¦µÃµ½Ôö¼Ó£¬²Å»áÈÃ×Ô¼ºÐÄ̤ʵһµã£¬Ë½ÐÎÒÊÇÒ»¸ö´óרÉúêÇ£¿ÎÒÒ²²»ÊÇÒòΪÎÒÊÇ´óרÉú¾ÍûÓÐ×ÔÐÅÁË£¬Ö»ÊÇ´ó¼Ò¶¼ÖªµÀ£¬ÓÐѧÀúµÄÈ˲¢²»Ò»¶¨ÓÐÄÜÁ¦£¬µ«ÊÇ×÷Ϊһ¸ö´óרÉú£¬ºÍËûÃÇÏà±È£¬ÎÒÃÇÓÖÄÜÓÐʲôÓÅÊÆÄØ£¿´ÓѧÀúÉÏÎÒÃÇÊ×ÏȾÍÊ䵿ÁË£¬ËùÒÔ£¬¶øÏÖÔÚÉç»áµÄÕÐÈ˵ÄÒªÇó°Ù·ÖÖ®Æß°ËÊ®¶¼ÊÇÒªÇ󣬲»µ£ÐijÉÂð£¿Èç¹ûÎÒÏÖÔÚ²»¾¡Á¿È¥Ñ§µÄ»°£¬ÎÒÃǾ͸üûÓÐÁ¢×ãÖ®µØÁË£¡×î½üÀÏÊǵ£ÓÇ£¬Ñ§Ï°µÄѹÁ¦Ô½À´Ô½´ó£¬µ«ÓÖÄÜÔõô°ìÄØ£¿Ö»Äܶ¥×ÅѹÁ¦×ßÁË£¬µ«Ò»¸öÈ˸оõµ½×îáÝáåµÄÊÇʱºò£¬¾ÍÊǼá³Ö¡£
×÷Ϊһ¸ö³ÌÐòÔ±£¬¶¼ÓôÃƵÄÊÂÇéÊÇà磬¾ÍÊǵçÄÔ»µÁË£¬ËùÓеĵÄ×ÊÁÏ£¬ËùÓеÄÊÓƵ£¬ËùÓеijÌÐò¶¼¶ªÊ§ÁË£¬Ò»ÄêÀ´µÄ¼Ç¼ÁË×Ô¼ºÔÚJAVAÕâÖÖ·Éϳɳ¤µÄ·Éϵijɳ¤¾ÀúµÄ±Ê¼Ç¶ªÊ§ÁË¡£
ΪÁËÔÚÏîÄ¿ÖÐʹÓÃSpring Security¿ØÖÆȨÏÞ£¬Ê×ÏÈÒªÔÚweb.xmlÖÐÅäÖùýÂËÆ÷£¬ÕâÑùÎÒÃǾͿÉÒÔ¿ØÖƶÔÕâ¸öÏîÄ¿µÄÿ¸öÇëÇóÁË¡£
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
ËùÓеÄÓû§ÔÚ·ÃÎÊÏîĿ֮ǰ£¬¶¼ÒªÏÈͨ¹ýSpring SecurityµÄ¼ì²â£¬Õâ´ÓµÚһʱ¼ä°ÑûÓÐÊÚȨµÄÇëÇóÅųýÔÚϵͳ֮Í⣬±£Ö¤ÏµÍ³×ÊÔ´µÄ°²È«¡£¹ØÓÚ¹ýÂËÆ÷ÅäÖõĸü¶à½²½â¿ÉÒԲο¼
ͬʱ»¹ÒªÔÚweb,xml½øÐÐ×¢²áspringµÄ»·¾³£¬
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext*.xml</param-value>
</context-param>
<listener>  
Ïà¹ØÎĵµ£º
ÎļþÉÏ´«·½·¨£¨Ò»´ÎÉÏ´«Ò»¸öÎļþ£¬¶à¸öÎļþµÄ»°£¬Çëдѻ·µ÷Óã©
Upload.uploadFile(theFile, filePath)
˵Ã÷£º
theFile£ºÀàÐÍÊÇFormFile
filePath£ºactionÖз¾¶»ñÈ¡·½·¨ this.getServlet().getServletContext().getRealPath("/")
µ÷Óô˷½·¨·µ»ØÎļþÉÏ´«ºóµÄ·¾¶Ãû
ÉÏ´«¶à¸öÎļþʱ£¬ÇëÉèÖÃÿ¸öÎ ......
JavaÈÝÆ÷Àà¿âÖ÷Òª°üº¬Á½ÖÖÀàÐÍCollection(List,Set,Queue)ºÍMap£¬ËüÃǵÄÇø±ðÔÚÓÚÿ¸ö²Û±£´æµÄÔªËظöÊý£¬CollectionÖ»±£´æÒ»¸ö£¬¶øMap±£´æ¼üºÍÖµ¡£
1.µ±Ê¹ÓÃArrays.asList()ʱ£¬Ëü»áÔÚʹÓÃÒ»¸öfinalµÄÊý×é×÷Ϊµ×²ãʵÏÖ£¬Òò´ËÈκÎÉè¼Æµ½¸ü¸ÄÆ䳤¶È´óСµÄ²Ù×÷¶¼½«Å×UnsuportedExceptioÒì³£¡£
2.finalµÄÊý×飬²»Äܸıä´óС£¬µ ......
×÷ΪApplet³ÌÐòµÄÒ»¸öÈëÃÅ£¬ÎÒÃǽñÌì̽ÌÖÒ»ÏÂÈçºÎʵÏÖÒ»¸ö°ë¾¶²»¶ÏÔö´óµÄСÇò¶¯»£¬ÕýÈçÏÂͼËùʾ¡£
Éè¼ÆµÄ¹Ø¼ü˼Ï룺
ÎÒÃÇÐèÒªÉ趨һ¸öСÇòµÄÔ²ÐÄ×ø±ê£¬×îºÃÊÇÔÚ´°¿ÚµÄÖÐÑ룬ȻºóÁîСÇòµÄ°ë¾¶²»¶ÏÔö´ó£¬²»¶ÏµÄÖػ棬ÒÔʵÏÖСÇòµÄÔö´ó¶¯»¡£
Éè¼Æ·½°¸£º
&n ......
ÔÚjava.lang°üÖÐÓÐString.split()·½·¨£¬·µ»ØÊÇÒ»¸öÊý×é
1¡¢Èç¹ûÓÃ"."×÷Ϊ·Ö¸ôµÄ»°£¬±ØÐëÊÇÈçÏÂд·¨£ºString.split("\\."),ÕâÑù²ÅÄÜÕýÈ·µÄ·Ö¸ô¿ª£¬²»ÄÜÓÃString.split(".");
2¡¢Èç¹ûÓÃ"|"×÷Ϊ·Ö¸ôµÄ»°£¬±ØÐëÊÇÈçÏÂд·¨£ºString.split("\\|"),ÕâÑù²ÅÄÜÕýÈ·µÄ·Ö¸ô¿ª£¬²»ÄÜÓÃString.split("|");
"."ºÍ" ......