• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

filter chain

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I can understand what is a filter.But I am really confused about
filter chain.Please give me some explanation.Thank you!
ruijin yang
 
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Yang:
You can try the examples from Chapter 14 of Professional JSP.
Basically, it goes through the filter class from one to another , just like a chain. At the end of the chain, if you call dofilter(), it will excute the servlet or JSP or HTML that you specified in the URL. It is more clear if you download the example form Professional JSP.
http://www.wrox.com/Books/Book_down.asp?sub_section=1&isbn=1861003625&subject=Java&subject_id=13
[This message has been edited by Win Yu (edited November 11, 2001).]
 
ruijin yang
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am still in confusion about filter chain.The following is quoted from Servlet Specification 2.3.
<filter-mapping>
<filter-name>Image Filter</filter-name>
<servlet-name>ImageServlet</servlet-name>
</filter-mapping>
<filter-mapping>
<filter-name>Logging Filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
** If there are filters matched by servlet name and the web resource has a servlet-
name, the container builds the chain of filters matching in the order declared
in the deployment descriptor. The last filter in this chain corresponds to
the last servlet-name matching filter and is the filter that invokes the target
web resource.
����My confusion:Does each filter in the chain correspond same servlet-name?Or each
filter in the chain correspond different servlet-name?If several filters applyied to
one servlet-name,are several filters all in filter chain?
** If there are filters using url-pattern matching and the url-pattern matches
the request URI according to the rules of SRV.11.2, the container builds the
chain of url-pattern matched filters in the same order as declared in the deployment
descriptor. The last filter in this chain is the last url-pattern matching
filter in the deployment descriptor for this request URI.
The last filter in
this chain is the filter that invokes the first filter in the servlet-name matching
chain, or invokes the target web resource if there are none.
����My confusion:What does it mean?The last filter in this chain is the last url-pattern matching
filter in the deployment descriptor for this request URI.
Please help.
ruijin yang

[This message has been edited by ruijin yang (edited November 12, 2001).]
[This message has been edited by ruijin yang (edited November 12, 2001).]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic