Java-servletfilter (Filter) example and detailed

Source: Internet
Author: User

Filter Introduction:

The filter in the servlet is a server-side program that implements the Javax.servlet.Filter interface, the main purpose of which is to filter the character encoding, make some business logic judgments (such as whether to login), etc.

It works as long as you configure the client request to intercept in the Web. xml file, it will help you intercept the request, and you will be able to request or respond to requests, Response

Unified set coding, simplify operations, but also to make logical judgments, such as whether the user has logged in, have access to the page and so on.

It starts with your web App only once, and then you can intercept the request and destroy it only when your web app is stopped or redeployed.

Java-servletfilter (Filter) example and detailed

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.