File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes What are filters?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "What are filters??" Watch "What are filters??" New topic
Author

What are filters??

Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
Do any body of u have idea about the filters??
and what are the conditions when they can be used??
Thanx in advance


Share Knowledge to gain it.
SCJP 2, SCWCD 2, SCDJWS, IBM 141 (In Progress), IBM 486 (Next)
Ko Ko Naing
Ranch Hand

Joined: Jun 08, 2002
Posts: 3178
Among the types of functionality available to the developer needing to use filters are the following:
� The accessing of a resource before a request to it is invoked.
� The processing of the request for a resource before it is invoked.
� The modification of request headers and data by wrapping the request in customized versions of the request object.
� The modification of response headers and response data by providing customized versions of the response object.
� The interception of an invocation of a resource after its call.
� Actions on a servlet, on groups of servlets, or static content by zero, one, or more filters in a specifiable order.

Here is sthing that I extract from the Servlet 2.4 Specification... Hope it helps you...


Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
I will try to out the filters..
can u please quote a real life example..may be that will make my idea a bit clear about filters...
Thanx Once again,,,
Thomas De Vos
stable boy
Ranch Hand

Joined: Apr 12, 2003
Posts: 425
Maybe you want to log every request before it arrives in your main servlet. This gives you the ability to remove the filter later without touching your base code.
Filtering can be used to manipulate also the headers of your request/response.
You can also use it for decompressing of your response before it is sent to the client.
Recording of sessions that are active on the server.
etc....
http://www.j2eecertificate.com


Try your free <a href="http://www.javacertificate.com" target="_blank" rel="nofollow">SCJP 1.4</a> certification centre.<br />Try your free <a href="http://www.j2eecertificate.com" target="_blank" rel="nofollow">SCWCD</a> certification centre.<br />Try your free <a href="http://www.ejbcertificate.com" target="_blank" rel="nofollow">SCBCD</a> certification centre.<br />Try your <a href="http://www.webspherecertificate.com" target="_blank" rel="nofollow">Websphere (Test 285) </a> certification centre.<br />Try your <a href="http://www.j2mecertificate.com" target="_blank" rel="nofollow">SCMAD</a> certification centre. (New)<br /> <br /><a href="http://blogs.javacertificate.com" target="_blank" rel="nofollow">Java/J2EE Certification Blogging</a>
Andy Smith
Ranch Hand

Joined: Sep 28, 2003
Posts: 239
Loggins is a good example ...
Basically i was not able to find the implication between the servlets and the filters... Yes now i think that filters basically can be added any time or removed to provide the common funcionality to all the servlets..
Moreover without touching the base servlet tcode....
m i rite???
Any other examples are Welcome..
Thanx a lot Thomas
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What are filters??