Knowledge about filters and related knowledge about Filters

Source: Internet
Author: User

Knowledge about filters and related knowledge about Filters

[Cookie technology]

* Use cookies to remember the user name and password.

[Filter: Overview of filters]

  • What is Filter:

Filters requests sent from the client to the server.

  • Filter usage:

* Filter IP addresses, use dirty words, log on automatically, and compress responses...

  • Use filter:

* Compile a class to implement the Filter interface:

* Configuration filter:

[Lifecycle of a filter]: (understanding)

  • Filter creation and destruction:

* Creation: when the server is started.

* Destruction: when the server is shut down.

 

[FilterChain: Filter chain]

 

The filter execution sequence in the filter chain is related to the configuration sequence of <filter-mapping>.

 

* DoFilter (request, response); -- allow, allow to the next filter. If there is no next filter, it reaches the target resource.

 

[Filter-related configuration]

 

  • <Url-pattern> Configuration:

 

* Full path match: Start With/demo4/demo1.jsp

 

* Directory match: Start with/and end with *./*/demo1 /*

 

* Extension matching: *. *. do *. action cannot start /.

 

 

 

  • <Servlet-name> Configuration: intercept the Servlet according to the Servlet name.

 

 

 

  • <Dispatcher> Configuration:

 

* REQUEST: default value.

 

* FORWARD: FORWARD.

 

* INCLUDE: contains.

 

* ERROR: ERROR page Jump. (Global ERROR page)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.