tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GuruPrasad <prasad...@yahoo.com>
Subject Re: Difference between Valve and javax.servlet.Filter?
Date Mon, 08 Apr 2002 23:24:54 GMT
Thanks craig for the answer, can you please tell me
what are the downside of using filter?i mean are there
any drawbacks if we have a filter like one of them
being performance?
Appreciate your help.

-
Thanks again,
Guru


--- "Craig R. McClanahan" <craigmcc@apache.org> wrote:
> 
> 
> On Wed, 20 Feb 2002, GuruPrasad wrote:
> 
> > Date: Wed, 20 Feb 2002 10:59:55 -0800 (PST)
> > From: GuruPrasad <prasadg75@yahoo.com>
> > Reply-To: Tomcat Developers List
> <tomcat-dev@jakarta.apache.org>
> > To: tomcat-dev@jakarta.apache.org
> > Subject: Difference between Valve and
> javax.servlet.Filter?
> >
> > What are the difference between Valve and Filter?
> >
> 
> Valves and Filters implement the same design pattern
> ("Chain of
> Responsibility" from the GoF book), so they can be
> used for similar sorts
> of things.  However, there are a couple of key
> differences:
> 
> * Filters are part of the servlet spec, and
> therefore portable
>   to any Servlet 2.3 environment, while Valves are
> specific
>   to Tomcat 4.x.
> 
> * Filters have access to ServletRequest and
> ServletResponse objects,
>   and can optionally wrap them to provide modified
> functionality.
>   Valves have access to the internal Request and
> Response implementation
>   objects, which have a lot more functionality --
> you can often
>   implement things by calling a property setter on
> the object directly
>   instead of by wrapping it.
> 
> The rule of thumb to use:  if you can implement your
> required
> functionality as a Filter or as a Valve, use a
> Filter to protect the
> portability of your application.
> 
> > -
> > Thanks,
> > prasad
> >
> 
> Craig
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-dev-help@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message