filter filter in servlet


The main role of the filter

  • 1. Any system or website must determine whether the user is logged in.
  • 2 , the network chat system or forum, the function is to filter the illegal text.
  • 3. Unified solution coding

 

How to create a filter:

  • 1. Generate a common class and implement the Filter interface (javax.servlet.Filter;) .
  • 2. Rewrite the three methods in the interface: init , doFilter , destroy .
  • 3 , and then configure the filter in web.xml .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325060948&siteId=291194637
Recommended