Site icon

What is filter in enterprise applications (java/ example)-Real world analogy

Custom Logging Filter using Jersey ContainerRequestFilter and ContainerResponseFilter

Filter request response execution flow

What is Filter in real world ?

Purpose of filters in a enterprise applications (java):

Web application filters are same as that of real time filters. The web application is nothing but the component, which also deals with request (input) and response (output). The filter in web application can intercepts both request and response. Typically filter can be used for following kind of operations

Request response flow in a typical web applications:

These are few functions/things we can achieve with Filters. We can intercept both request and response, we can perform the actions as per our use case scenario.

Fig 1: Interaction of Client and Service (Running on server)

We have introduced 3 filters (Filter 1, Filter 2 & Filter 3). The request response flow is shown in Fig 1 is as follows:

We have discussed about the application of filter in post Create the logging filter in java using jersey framework.

Exit mobile version