If a book does not discuss filters than either:
a) Its not a good book
b) Its about Servlet api 2.2 or less and time to get a new book.

Filters are "new" to Serlvet api 2.3.

Sun provides a lot of good free docs:
http://java.sun.com/products/servlet/docs.html

On that page is an article about filters:
http://java.sun.com/products/servlet/Filters.html

-Tim


Gavin, Rick wrote:
------------
I'd recommend getting a Serlvet programming book and optionally a JSP book. They will come in very handy for these questions.
------------
really? I have one of each, neither mention the subject or either
classes mentioned. Maybe before you make a vague suggestion like "get a book" , you may want to qualify about whether or not the desired result is possible and suggest an appropriate resource that may actually contain said information( book title, etc,).


Its always nice to try something a little different and be demoted
to idiot status with the statment , "get a book"

Does anyone have an useful information

-Rick


-----Original Message----- From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 18, 2003 11:02 AM To: Tomcat Users List Subject: Re: Extending HttpServletRequest / HttpServletResponse ???


I'd recommend getting a Serlvet programming book and optionally a JSP book. They will come in very handy for these questions.


valve - Tomcat specific
filter - "Like" a valve but portable across other servlet containers because its part of the serlvet specification.


requests/response can be wrapped by the Servlet wrapper classes which are part of the Servlet API. A book will really help clear the specifics up of why and when to use them.

Never ever use catalina classes directly unless:
- You really need to
- You really know why you are using them
- You really need to


-Tim


Gavin, Rick wrote:

Thanks Bill,
 Does anyone have some docs about using this feature?  I haven't been

able


to find much on the jakarta site.  I'm a bit confused as to what the
difference between a <valve> and a <filter> is. and which is the corret

one


to use. When i search for filter, i get info on <valve>s. I haven't

found


anything on how to use a <filter>.

Also, if i use a wrapper to extend the request/response objects, does

that


mean in a JSP page i would be able to access any extra methods i wanted to
add.. such as..

-- in jsp file --
String value = request.doMyNewAction(param1);

is it recommeded to use the catalina wrapper objects when working with
tomcat or the javax wrappers?

org.apache.catalina.connector.HttpRequestWrapper
or
javax.servlet.http.HttpServletRequestWrapper


Thanks for the help,


Rick

-----Original Message-----
From: Bill Barker [mailto:[EMAIL PROTECTED]
Sent: Friday, March 14, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Extending HttpServletRequest / HttpServletResponse ???


It depends on the version. The answer is no for Servlet-2.2 containers (e.g. Tomcat 3.x). The answer is yes for Servlet-2.3 containers (e.g. Tomcat 4.x). In fact, for Servlet-2.3 containers it is one of the most common things that a Filter does.

If you are using Tomcat 4.x, then look into HttpServletRequestWrapper and
HttpServletResponseWrapper (both in the javax.servlet.http package).

"Gavin, Rick" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Hi All
Is it possible to extend request and response objects to add a few

custom



properties and / or methods relating to a particular system, and have

tomcat



use those instead of the standard request and resonse objects?

Thanks,

Rick




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to