asked in JSP by (58.6k points)

1 Answer

JSP Filters are Java classes that can be used in JSP Programming for the following purposes −

  • To intercept requests from a client before they access a resource at back end.

  • To manipulate responses from server before they are sent back to the client.

  • Filters are defined in the deployment descriptor file web.xml and then mapped to either servlet or JSP names or URL patterns in your application's deployment descriptor.

    When the JSP container starts up your web application, it creates an instance of each filter that you have declared in the deployment descriptor. The filters execute in the order that they are declared in the deployment descriptor.

answered by (58.6k points)

Java Interview Questions and Answers 2018