On Wed, 1 Nov 2000, Peter Smith wrote:
> Hi,
>
> Thanks for your answer. One thing that I'm still not clear:
> in init() method, we can use System.out.println to output some
> error message in try/catch. So, where does the error message go?
As has been hashed out so far, from init(), you can't output to the
web page, because you're not necessarily within the context of an http
request/response, and you don't have access to the response.
The answer is that where output to System.out (and also System.err)
goes is implementation dependent. Most likely it goes to a file
somewhere, and some servlet containers will allow you to specify which
file it should go to. Check your servlet container documentation.
> >From: Joe Hall <[EMAIL PROTECTED]>
> >Subject: Re: A Simple Question
> >Date: Wed, 1 Nov 2000 16:16:01 -0500
> >
> >The init() method is called when the servlet is instantiated. It
> >does not output to the http response. You can try storing your
> >data in an instance variable then using it in doGet(), doPost().
> >
> >-----Original Message-----
> >From: Peter Smith [mailto:[EMAIL PROTECTED]]
> >Sent: Wednesday, November 01, 2000 5:13 AM
> >Subject: A Simple Question
> >
> >Hi:
> >
> >I'm new on Java servlet. My question is:
> >
> >In init() method,
> >System.out.println("some string");
> >doesn't output to the web page, is that right?
> >If it is, how can we get some information to stand output in
> >init() method?
> >
> >Thanks in advance,
> >
> >Peter
>
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]
___________________________________________________________________________
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