Knowledge about filters and related knowledge about Filters
[Cookie technology]
* Use cookies to remember the user name and password.
[Filter: Overview of filters]
Filters requests sent from the client to the server.
* Filter IP addresses, use dirty words, log on automatically, and compress responses...
* 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)