What is Servlet Filter And What does it work?

Answer Posted / surajkumar.java

Filters are powerful tools of Servlet platform. These are
just like a servlet which plugs into the request handling
process and executes in addition to the normal page
processing. Filters manipulate both request and response in
web application. Filters can be applied to any resources
like HTML, graphics, a JSP page, servlet etc, served by a
servlet engine. These are commonly used for authentication,
data format conversion and page redirect to other page and
catching etc.
A java class which implements javax.servlet.Filter is
configured as filter in web.xml file. For each request in
web application, the servlet container decides which filters
to apply, and adds those filters to a chain in the same
order they appear in web.xml. As a filter is just like a
servlet, it has its life cycle (init(), doFilter() and
destroy() methods).

Is This Answer Correct ?    22 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is “abc” a primitive value?

619


when A client sent a request to the server to open facebook page and close the browser after this request .at that time the same user do login by using a different browser then that session id will exist or not for the same client??

1110


What restrictions are placed on the values of each case of a switch statement?

541


What is aop(assepct oriented programing)?

585


Do we need to override service() method

1145






Name three component subclasses that support painting?

620


If I wanted to use a solarisui for just a jtabbedpane, and the metal ui for everything else, how would I do that?

574


Why are my checkboxes not being set from on to off?

650


Is infobus easy to use?

600


How substring() method of string class create memory leaks?

552


When is the best time to validate input?

612


For which statements does it make sense to use a label?

593


Is it possible to stop the execution of a method before completion in a sessionbean?

604


Why is actionform a base class rather than an interface?

574


What is permgen or permanent generation?

588