Best would be to have all the classes use the same type of
stream, and pass it as an argument to them.

If they're already developed and have different types,
perhaps you could convert?

On Tuesday, August 31, 1999 2:40 PM, Message UK
[SMTP:[EMAIL PROTECTED]] wrote:
> Hi all. I have a servlet which uses several other classes.
I
> want these
> classes to output to "out", but I don't know if I should
> create a new output
> stream for each, or use just one and pass it to the other
> objects to use.
> Any advice?
>
>
> Also, I have been passing the request and response objects
> to other objects,
> is this correct?
>
> example:
>
> public ServletAssistant(Rete r, Reader rdr,
> HttpServletRequest req,
> HttpServletResponse res)
> throws IOException
> {
> 1 this.r = r;
> 2 this.rdr = rdr;
> 3 file://define the type of data the browser can receive
> 4 res.setContentType("text/html");
> 5
> 6 file://set the servlet's output stream
> 7 PrintWriter out = res.getWriter();
> 8 file://rdr = r.getInputRouter("t"); file://set rdr to
> Jess's input router
> 9
> 10 file://redirect Jess's output to servlet output stream
> 11 r.addOutputRouter("t", res.getWriter()); file://send
> standard output 12
> from JESS to the servlet's output
>
>
> }
>
>
> please note that the code on lines 6 to 12 appear in a
class
> which creates
> and instance of ServletAssistant
>
>
> Many thanks. D Lampon
>
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
>
>
____________________________________________________________
> _______________
> 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

Reply via email to