Re: Help with chaining servlets via filters

2002-07-23 Thread Craig R. McClanahan



On Tue, 23 Jul 2002, John Rishea wrote:

 Date: Tue, 23 Jul 2002 06:33:57 -0600
 From: John Rishea [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat User Group [EMAIL PROTECTED]
 Subject: Help with chaining servlets via filters

 Could someone please point me toward a good resource that shows an example
 of chaining two servlets using a filter?  I've found lots of filter examples
 during my google searches but none of them shows exactly how to chain two
 servlets together with a filter.


What are you trying to accomplish by chaining two servlets using a
filter?  The traditional definition of servlet chaining (feeding the
output of one servlet into another) has turned out to be a very bad design
pattern, so it's not supported.

On the other hand, filters themselves can modify input on the way in, and
output on the way out.  And you can easily configure more than one filter
to be mapped to a particular request.

It all comes down to what you are trying to accomplish.

 Thanks for the help.

 __
 John Rishea

Craig


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




RE: Help with chaining servlets via filters

2002-07-23 Thread John Rishea

Craig,

I have one servlet that runs a unix script using runtime exec to create an
output file, then a follow-up servlet that takes the output file and
displays it to a browser window.  The servlets work fine separately but
don't work when combined into a single servlet.  So I was looking for a way
to call the display servlet immediately after the script-running servlet
does its thing.

Any constructive suggestions would be appreciated.
__
John Rishea

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 9:47 AM
To: Tomcat Users List
Subject: Re: Help with chaining servlets via filters




On Tue, 23 Jul 2002, John Rishea wrote:

 Date: Tue, 23 Jul 2002 06:33:57 -0600
 From: John Rishea [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat User Group [EMAIL PROTECTED]
 Subject: Help with chaining servlets via filters

 Could someone please point me toward a good resource that shows an example
 of chaining two servlets using a filter?  I've found lots of filter
examples
 during my google searches but none of them shows exactly how to chain two
 servlets together with a filter.


What are you trying to accomplish by chaining two servlets using a
filter?  The traditional definition of servlet chaining (feeding the
output of one servlet into another) has turned out to be a very bad design
pattern, so it's not supported.

On the other hand, filters themselves can modify input on the way in, and
output on the way out.  And you can easily configure more than one filter
to be mapped to a particular request.

It all comes down to what you are trying to accomplish.

 Thanks for the help.

 __
 John Rishea

Craig


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


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




RE: Help with chaining servlets via filters

2002-07-23 Thread Jacob Hookom

http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html

Jacob Hookom 
Comprehensive Computer Science 
University of Wisconsin, Eau Claire 


-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, July 23, 2002 10:47 AM
To: Tomcat Users List
Subject: Re: Help with chaining servlets via filters



On Tue, 23 Jul 2002, John Rishea wrote:

 Date: Tue, 23 Jul 2002 06:33:57 -0600
 From: John Rishea [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat User Group [EMAIL PROTECTED]
 Subject: Help with chaining servlets via filters

 Could someone please point me toward a good resource that shows an
example
 of chaining two servlets using a filter?  I've found lots of filter
examples
 during my google searches but none of them shows exactly how to chain
two
 servlets together with a filter.


What are you trying to accomplish by chaining two servlets using a
filter?  The traditional definition of servlet chaining (feeding the
output of one servlet into another) has turned out to be a very bad
design
pattern, so it's not supported.

On the other hand, filters themselves can modify input on the way in,
and
output on the way out.  And you can easily configure more than one
filter
to be mapped to a particular request.

It all comes down to what you are trying to accomplish.

 Thanks for the help.

 __
 John Rishea

Craig


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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.375 / Virus Database: 210 - Release Date: 7/10/2002
 


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




RE: Help with chaining servlets via filters

2002-07-23 Thread Craig R. McClanahan



On Tue, 23 Jul 2002, John Rishea wrote:

 Date: Tue, 23 Jul 2002 10:09:50 -0600
 From: John Rishea [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: Tomcat Users List [EMAIL PROTECTED]
 Subject: RE: Help with chaining servlets via filters

 Craig,

 I have one servlet that runs a unix script using runtime exec to create an
 output file, then a follow-up servlet that takes the output file and
 displays it to a browser window.  The servlets work fine separately but
 don't work when combined into a single servlet.  So I was looking for a way
 to call the display servlet immediately after the script-running servlet
 does its thing.

 Any constructive suggestions would be appreciated.

Why can't you just modify the servlet that runs the unix script to copy
the output back to the client after the script executes?

If the second servlet needs to perform modifications in the output format
(such as converting static text into HTML, or performing an XSLT
transformation on an XML file), that's the kind of things that a Filter is
for.  Search Google and java.sun.com for filter and you'll find lots of
tutorials, resources, and examples of how to build such a thing.

 __
 John Rishea

Craig


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