Ah so! I have the PDF file and have read most of it, but had not
paid much attention to the filters section. Thanks for the
reference and the snippet. I am still dubious as to your claim
that filter-JSP architecture is superior to MVC, but I have an
open mind about it and will do some homework. I believe,
especially on an interest list such as this, in the old saying,
"Give a man a fish and he will not be hungry for a day; teach him
to fish and he'll not go hungry for life." Again, thanks for the
pointer (ooh...a C reference? :-) ) to the reference
documentation!
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