213 Servlet Filter | Servlet Tutorial Advanced java servlet tutorial | What is Servlet Filter ? Java

Published: 05 June 2020
on channel: tech fort
187
1

Servlet Filter : What is ServletFilter? - Servlet Filter is a special web resource program of java web application, that trap's request and response of other web resource programs of java web application.

- Servlet filter program can execute pre-request processing logic by trapping the request and it can also executes post-response generation logic by trapping the response.

Need/Use: To provide additional functionality in the web application without modifying the source code of existing web application, then we can take the support of filters in java web application.

Understanding Example diagram of Servlet filter
(1 diagram of Servlet filter):
------------------------------------------------




With respect to above diagram:
------------------------------
Step 1) Browser window gives request to TestSrv program.

Step 2), 3) Filter traps the request and executes pre-request processing logic.

Step 4), 5) Servlet filter passes the request To TestSrv servlet program & this program executes the main request processing logic.

Step 6), 7) Servlet program generates response to browser window and this response will be trapped by Servlet filter program and also executes post-response generation logic.

Step 8) Filter program sends final response to browser window.

Note: To link servlet filter with servlet program we need to take the url-pattern of servlet program as the url-pattern of ServletFilter program.


On this page of the site you can watch the video online 213 Servlet Filter | Servlet Tutorial Advanced java servlet tutorial | What is Servlet Filter ? Java with a duration of hours minute second in good quality, which was uploaded by the user tech fort 05 June 2020, share the link with friends and acquaintances, this video has already been watched 187 times on youtube and it was liked by 1 viewers. Enjoy your viewing!