Doh! I already had the 2.3 Spec in PDF (and I just scanned the
filter stuff), AND the 2.3 API on my hard drive (just hadn't
unzipped it yet). I assume, there must be a 2.3 JSDK if you are
referencing a Filter class, but I cannot find in on Sun's
site.... :-(
Cheers!
Mark
----- Original Message -----
From: "Nic Ferrier" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, April 19, 2001 2:39 PM
Subject: Re: MVC and Nic
> >>> Mark Galbreath <[EMAIL PROTECTED]> 19-Apr-01 7:20:56 PM >>>
>
> >Okay, now I'm a little fuzzy (fuzzy logic?) on your filter
thing.
> >Do you mean filters in what I consider the standard sense of
> >piping bytes through various input/output streams and
encoders,
> >or are you talking about something else? If not too much
> >trouble, would you give a concrete (i.e., code) example?
>
> Filters are explained in detail in Servlet API 2.3 PFD. You can
get
> it from the Sun Java-Servlet website.
>
> Here's a skeleton example:
>
> class MyFilt
> extends Filter
> {
>
> public void doFilter(ServletRequest req,
> ServletResponse resp,
> FilterChain c)
> throws...
> {
> HttpSession session=request.getSession(false);
> if(session!=null)
> {
> Connection
con=(Connection)session.getAttribute("dbcon");
> Statement st=con.createStatement("select * from
> thingies;");
> ResultSet rs=st.executeQuery();
> request.setAttribute("results",rs);
> }
> c.doFilter(request,response);
> }
> }
>
> The JSP recieving the request can then print out the results of
the
> query. Of course, a lot more could be done. You could override
the
> request or the response objects to provide new methods.
>
> This is better than MVC because it's using pure code to
decorate the
> request/response. Also the logic of dispatch plumbing has been
> abstracted so that it's more managable.
>
>
> Nic
>
>
_________________________________________________________________
__________
> To unsubscribe, send email to [EMAIL PROTECTED] and include
in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives:
http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html