´«ÖDz¥¿ÍJAVAÅàѵ20100524SPRING SECURITY
´«ÖDz¥¿ÍJAVAÅàѵ20100524SPRING SECURITY
ÕâÁ½Ìì·´·´¸´¸´µÄ¿´ÁËÙ¡¸ÕÀÏʦµÄ½ÌÓý°ì¹«¹ÜÀíϵͳµÄÏîÄ¿ÊÓƵ£¬ÕæÊǸоõµ½¸ÃÀÏʦÕæÊÇÇ¿´ó£¬½²µÄÏîÄ¿·Ç³£Óм¼Êõº¬Á¿£¬ËäÈ»µ½ÏÖÔÚÎÒ¶¼»¹ÊÇ°ëÖª°ë½â£¬µ«ÊǶÔÓÚÒÔºóµÄ·¢Õ¹£¬ÎÒÒ²Ò»Ïë·Ç³£ÓÐÓã¬ÒòΪÕâô¸´Ï°µÄÔ´´úÂ룬Èç¹û»»×ÅÒ»¸öÐÂÈËÀ´µÄ»°£¬²»ÖªµÀÒª¶à¾Ã²ÅÄܳÔ͸Ŷ£¡ÎÒÖ®ËùÒÔÓÐÕâÑùÉî¿ÌµÄ¸ÐÊܵÄÔÒò£¬ÊÇÒòΪÒÔÇ°ÎÒÔÚ¹«Ë¾µÄʱºòÒ²ÊÇÓõÄspring security×öµÄȨÏÞ¿ØÖÆ£¬ÄǸöʱºòÎÒ¿´Á˺öàÌ죬»¹ÊÇÒ»ÎÞËùÖª£¬Ö»¹Ö×Ô¼ºÖ»ÊǶ¡µãË®£¬¿´²»¶®Ò²ºÜÕý³££¬Åå·þ£¡ÕâÒ²ÊÇÎÒ½ø´«ÖÇÒԺ󣬸ÐÊÜ×îÉî¿ÌµÄÒ»Ì죬ÕÛ·þÁË¡£
µ«ÊÇ£¬²»ÖªµÀ×Ô¼ºÒªÔõô³ÉΪÕâÑùµÄˮƽÄØ£¿Ôõôȥ¿´Ô´´úÂë²ÅÊÇ×îÓÐЧµÄµÄÄØ£¿Ò²³ÉΪÁËÏÖÔÚÎÒµÄĿ¼£¬¼È±ãÊÇÏÖÔÚ£¬ÎÒ¶ÔÕâ¸ö¿ò¼ÜÉæ¼°µ½µÄ³ÌÐò»¹ÊǷdz£Ð¡µÄ£¬ÒòΪ×ÔÒÑÏÖÔÚµÄˮƽÕæµÄ»¹ÊÇÌ«²ËÁË£¬ÆñÄÜÓëËûÃÇÕâÖÖÈËÀ´×ö±È½ÏŶ£¬µ«Êǹ¤×÷ÁË£¬¿ÉûÓÐÈËÀ´¸øÄãÈÃÕâÑùµÄ¿Î£¬¹¤×÷Ö®ºó£¬ÊÇÄã×Ô¼ºÈ¥ÃþË÷£¬×Ô¼ºÈ¥Àí½âÆäÖеÄ֪ʶ£¬Ë¶¼°ïÖú²»ÁËÄ㣬ËùÒÔûÓа취£¡“ûÓÐÀ§ÄÑ£¬Ò²Òª´´ÔìÀ§ÄÑ£¬ÓÄѶøÉÏ”£¬ÕâÑù²Å¶Ô×Ô¼ºµÄÌáÉýÓкô¦£¬Èç¹ûÌìÌì±àдһЩµÍ¼¶±ðµÄ´úÂ룬ÓÚ¼ºÊǾø¶ÔûÓкô¦µÄ£¬Ò²²»ÒªÏÝÈëÄãÌýÆðÀ´ÇáËɵĿξÍÊǺÿÎŶ£¬ÒòΪÌýµÃ¶®µÄ£¬ºÜÈÝÒ×ѧ»áµÄ±ðÈ˶¼ÈÝÒ×ѧ»á£¬Ëùν“³ÔµÃ¿àÖп࣬ÔÚÄܳÉΪÈËÖÐÈË”£¬ÔÚÕâ¸öÐÐÒµ£¬ÒªÏë´Óǧ¾üÍòÂíÈËÆ´³öÒ»Ìõ·À´£¬¿Ï¶¨ÒªÓÐ×Ô¼ºµÄ³¤´¦¡£
Èç¹ûÎÒÃÇÕæµÄÄÜÎüµ½ÀÏʦ´«ÊÚµÄ֪ʶ50%,ÎҾ͸оõÊǷdz£Å£µÄÈË£¬Èç¹ûÄãÄÜÔÚÕâÆÚ¼äÎüÒýµÃ¸ü¶à£¬ÎÒÖ»ÄÜ˵£¬ÄãÊÇÕæµÄºÜÅ££¡¹¤×÷»¹²»ÊÇË®µ½Çþ³É£¡ÒòΪ١¸ÕÀÏʦ´«ÊڵIJ»¹âÊÇѧϰµÄ֪ʶ£¬¸üÊÇÒ»ÖÖ̬¶È£¬¶Ô´ý¹¤×÷µÄ̬¶È£¬ËäȻѧÆðÀ´ºÜÄÑ£¬µ«Êǹ¤×÷Öв»ÊÇ×Ü»áÓöµ½À§ÄÑÂð£¿Èç¹ûÒ»Óöµ½À§ÄÑÄãÔÚ¶ãÔÚ°µ´¦£¬ÉõÖÁÏñÓÐЩͬѧһÑù£¬²»È¥ÉϿεĻ°£¬Ö»ÄÜ˵ÊÇÒ»°ÜÍ¿µØÁË¡£
ÎÒÏÖÔÚ×îÏë˵ÊǵģºÖÕÀÏʦ¡£ÎÒÌ«³ç°ÝÄãÁË£¡
Spring securityÊÇʲô£¿È¨ÏÞ¿ò¼Ü¡£ÒÔÉùÃ÷µÄ·½Ê½À´±£»¤WebÓ¦ÓóÌÐòµÄURL·ÃÎÊ£¬Ö»ÐèÒª¼òµ¥µÄÅäÖü´¿É£¡
Web.xmlÖÐÅäÖãº
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/application*.xml</param-value>
</context-param>
<filter>
<filter-name>spring
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
1.1.1 ÐÞÁ¶µÚÒ»²ã¾³½ç£º½£Ö¸ËÄ·½£¬ÊÔÎÊÌìÏÂÓëÕù·æ
ÐÞÁ¶µÚÒ»²ã¾³½çµÄ³ÌÐòÔ±£¬¶ÔJava¿ª·¢¼¼Êõ¾¡ÊýÕÆÎÕ£¬¿ª·¢¹¤¾ßÕÆÎÕµÃÒ²½ÏΪæµÊì¡£¿ÉÒÔ½«µÚ¶þ²ã´Î³ÌÐòÔ±½»¸øµÄÈÎÎñÍê³ÉµÃºÜ³öÉ«£¬¿ÉÒÔ°´ÒªÇó¶ÀÁ¢Íê³ÉÀà¡¢½Ó¿ÚºÍËã·¨µÄ¿ª·¢¡£×¢Öؼ¼ÇÉ£¬¶Ô¾ßÌåµÄ±à³ÌÓïÑԷdz£ÊìϤ¡£
ÄÜÁ¦Ö®Ëù¼°£¬½ÔÎÞ²»ÓÃÆ伫¡£ÈÏΪËùÓпª·¢ÖªÊ¶£¬Ô½ÊÇ¿´Æ ......
×ܵĸñʽÊÇ£º
%[argument_index$][flags][width][.precision]conversion
ÀýÈ磺
%2$-5.2s
//2$£ºÈ¡µÚ¶þ¸ö²ÎÊý
//-: Ö¸¶¨Îª×ó¶ÔÆ룬ĬÈÏÓÒ¶ÔÆë
//5£º×î´óÊä³ö¿í¶ÈΪ20,²»¹»»á²¹¿Õ¸ñ£¬Êµ¼ÊÈô³¬¹ýÔòÈ«²¿Êä³ö
//.2£ºÔڴ˱íʾÊä³ö²ÎÊý2µÄ×î´ó×Ö·ûÊýÁ¿£¬Èç¹ûÊǸ¡µãÊý×Ö£¬Ôò±íʾСÊý²¿·ÖÏÔʾµÄλÊý
//s £º±íʾÊäÈë²ÎÊýÊÇ×Ö ......
instanceofÊÇJavaµÄÒ»¸ö¶þÔª²Ù×÷·û£¬ºÍ==£¬>£¬<ÊÇͬһÀණ¶«¡£ÓÉÓÚËüÊÇÓÉ×Öĸ×é³ÉµÄ£¬ËùÒÔÒ²ÊÇJavaµÄ±£Áô¹Ø¼ü×Ö¡£ËüµÄ×÷ÓÃÊDzâÊÔËü×ó±ßµÄ¶ÔÏóÊÇ·ñÊÇËüÓұߵÄÀàµÄʵÀý£¬·µ»ØbooleanÀàÐ͵ÄÊý¾Ý¡£¾Ù¸öÀý×Ó£º
¡¡¡¡String s = "I AM an Object!";
¡¡¡¡boolean isObject = s instanceof Object;
¡¡¡¡ÎÒÃÇÉùÃ÷ÁËÒ»¸öStrin ......