what is filters and its use?

Answers were Sorted based on User's Feedback



what is filters and its use?..

Answer / guru

filters r java classes which is intercept the client request
before it access a resource in server,then it intercept
server response before its reach clint

request filter

for security

response filter

compresed data

init(),do filter(),destroy are methods of filter

Is This Answer Correct ?    3 Yes 0 No

what is filters and its use?..

Answer / puneet

The ans cudhave been more precise: let me try :)
The filters are basically used when we need to change the
response sent back to the client like implementing
restrictions to few of the resources dependent on the user
who logs in like we dnt need to show few pages to few users
from a website then we need to make that logic in a new
class which implements filter interface and need to write
down the logic in the dofilter method which takes the
response and request objects which can be altered and
changed and the object of this class can be called dependent
on the condition of met on which we want to implement the
restrictions.

We can also use this interface to change the behavior of the
response.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More Core Java Interview Questions

How GC (Garbage Collector) knows the objects reference is unused.Whether GC removes the unused object Parmanently or it maintains something.

2 Answers  


What is difference between string and new string?

0 Answers  


What is a function easy definition?

0 Answers  


How long will it take to learn java?

0 Answers  


What is variable argument in java?

0 Answers  






how we can create packages in java?

0 Answers  


Explain Stream Tokenizer?

4 Answers  


what is difference between excute query ()and execute update ()?

6 Answers   Symphony,


Can a class be a super class and a sub-class at the same time? Give example.

1 Answers  


what is the default value of a variable char?(If not assigned)

4 Answers  


How to pass arraylist to stored procedure in java?

0 Answers  


Different types of Layouts?

11 Answers  


Categories