Explain Life cycle of Servlet Filter.
Answer Posted / surajkumar.java
A java class which implements javax.servlet.Filter is
configured as filter in web.xml file.
The web container calls the init method to initialize filter
by passing javax.servlet.FilterConfig object to retrieve the
filter’s init parameters.
The doFilter method of Filter class performs the actual
processing like authentication, data format conversion and
page redirect to other page and catching etc. The doFilter
method passes the request and response object of the current
request and the filter chain object to invoke next filter in
the chain.
Web container calls the destroy() method to take the filter
out of service.
| Is This Answer Correct ? | 29 Yes | 7 No |
Post New Answer View All Answers
What is scalable, portability in the view of J2EE?
What happens when a thread cannot acquire a lock on an object?
Are we allowed to change the transaction isolation property in middle of a transaction?
What are JTA/JTS and how they used by client?
Why is string immutable in java?
What is the relationship between the canvas class and the graphics class?
What are the different approaches to represent an inheritance hierarchy?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
What is the diffrence between a local-tx-datasource and a xa-datasource? Can you use transactions in both?
why static class in java
Explain how will the struts know which action class to call when you submit a form?
What do you mean by Socket Programming?
Why are component architectures useful?
What is a session? Can you share a session object between different theads?
What are the types of scaling?