wood burning stoves 2.0*
The moose likes JSP and the fly likes Filter doubts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Filter doubts" Watch "Filter doubts" New topic
Author

Filter doubts

Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
What is the main purpose of Filter? I can't get it.. Why/where to use filters?


Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

read (online) the chapter 9 : Servlet And Jsp Filters of SERVLETS and JAVASERVER PAGES by Marty Hall


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
You might also be interested in this thread.


Fun programming etcetera!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Filters are used for any purpose for which you may wish to pre-process or post-process requests.

For example, I extensively use filters for authentication checking.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Typically fitlers are used for caching purpose, authentication puropose (as Bear already mentioned), compression purpose and etc.
Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Why we have to use Filters for authentication? If I am configuring the DD with <login-config>BASIC/DIGEST</login-config>, it will take care of the authentication? Then Why we should use Filters for authentication?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60782
    
  65

Not all authentication requirements can be handled by the simple, built-in schemes.
Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Thanks to all of you and especially to Saif uddin, who gievn the wondeful link to Filters by Hall and his explanation is good and thanks once again thanks to (H)all!!

[ January 16, 2007: Message edited by: Micheal John ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Filter doubts
 
Similar Threads
automaticall set https in url with jsp
WA #1.....word association
Logging while clicking on link
I want to filter some javaranch pages for reading?
Better way to check user session