ÉèΪÊ×Ò³ ¼ÓÈëÊÕ²Ø

TOP

Java FilterµÄÖ´ÐÐ˳Ðò
2014-11-24 07:34:53 À´Ô´: ×÷Õß: ¡¾´ó ÖРС¡¿ ä¯ÀÀ:1´Î
Tags£ºJava Filter Ö´ÐР˳Ðò

IMPORTANT: The Container¡¯s rules for ordering filters:1) ALL filters with matching URL patterns are located first. This is NOT the same as the URL mapping rules the Container uses to choose the ¡°winner¡± when a client makes a request for a resource, because ALL filters that match will be placed in the chain!! Filters with matching URL patterns are placed in the chain in the order in which they are declared in the DD.BeerRequest1*.doBeerRequest2AdviceServletWrite down the sequence in which the filters will be executed for each request path. Assume Filter1 - Filter5 have been properly declared.


When more than one filter is mapped to a given resource, the Container uses the following rules:


2) Once all filters with matching URLs are placed in the chain, the Container does the same thing with filters that have a matching in the DD.


˵°×Á˾ÍÁ½Ìõ£º


1£©ÏÈÖ´ÐдøÓÐurl-pattern±êÇ©µÄfilter£¬ÔÙÖ´ÐдøÓÐservlet-name±êÇ©µÄfilter¡£Á½ÖÖ±êÇ©µÄÊéд·½Ê½ÈçÏ£º



BeerRequest1
*.do

BeerRequest2
AdviceServlet


ǰÕßÓÅÏÈÖ´ÐС£


2£©Èç¹ûͬΪurl-pattern»òservlet-name£¬Ôò»á°´ÕÕÔÚweb.xmlÖеÄÉùÃ÷˳ÐòÖ´ÐС£


ÏÂÃæ¾Ù¸öÀý×Ó£º



Filter1
/Recipes/*


Filter2
/Recipes/HopsList.do


Filter3
/Recipes/Add/*


Filter4
/Recipes/Modify/ModRecipes.do


Filter5
/*


Request path Filter Sequence
/Recipes/HopsReport.do 1, 5
/Recipes/HopsList.do 1, 5, 2
/Recipes/Modify/ModRecipes.do 1, 5, 4
/HopsList.do 5
/Recipes/Add/AddRecipes.do 1, 3, 5


¡¾´ó ÖРС¡¿¡¾´òÓ¡¡¿ ¡¾·±Ìå¡¿¡¾Í¶¸å¡¿¡¾Êղء¿ ¡¾ÍƼö¡¿¡¾¾Ù±¨¡¿¡¾ÆÀÂÛ¡¿ ¡¾¹Ø±Õ¡¿ ¡¾·µ»Ø¶¥²¿¡¿
·ÖÏíµ½: 
ÉÏһƪ£ºAndroidÖ®¸ß·Â·É¸ë´«ÊéÈȵ㴴½¨Óë.. ÏÂһƪ£ºC++ Ð麯ÊýÓë´¿Ð麯Êý

ÆÀÂÛ

ÕÊ¡¡¡¡ºÅ: ÃÜÂë: (ÐÂÓû§×¢²á)
Ñé Ö¤ Âë:
±í¡¡¡¡Çé:
ÄÚ¡¡¡¡ÈÝ:

¡¤Linuxϵͳ¼ò½é (2025-12-25 21:55:25)
¡¤Linux°²×°MySQL¹ý³Ì (2025-12-25 21:55:22)
¡¤Linuxϵͳ°²×°½Ì³Ì£¨ (2025-12-25 21:55:20)
¡¤HTTP Åc HTTPS µÄ²î„ (2025-12-25 21:19:45)
¡¤ÍøÕ¾°²È«±ØÐ޿ΣºÍ¼ (2025-12-25 21:19:42)