> You need to get a PrintWriter object
> and then it should work:
> PrintWriter pw = response.getWriter();
> pw.println("The user name you provided is incorrect");
I assumed Suresh's question was a JSP problem, but I'm not sure. If it
is JSP related, I don't think Ken's suggestion fixes it; out is an implicit
JSP object.
My first thought is something more simple, such as syntax not shown in
the example; but, spec version 1.1 indicates two other possible problems:
Spec 1.1 indicates a possible problem caused by buffering... check the
autoflush page directive in the spec. Change the buffer state or out.flush()
should fix this the problem.
Spec 1.1 indicates another possible problem. The "initial" state of out
is a new JspWriter object, suggesting the possibility that out may be
re-assigned to a nested instance of JspWriter. if so, what problems may this
cause?
The spec also says, "Jsp authors are prohibited from writing directly
to... the PrintWriter... associated with the ServletResponse." Does this
pose a problem with Ken's suggested code? I don't know.
Phil
-----Original Message-----
From: Ken Pullin <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, December 01, 1999 7:36 PM
Subject: Re: Using out.println to write on the browser - Doesn't Work !!!
>You need to get a PrintWriter object and then it should work:
>
>PrintWriter pw = response.getWriter();
>pw.println("The user name you provided is incorrect");
>
>Ken
>
>-----Original Message-----
>From: Suresh Kumar Nittala [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 01, 1999 11:13 AM
>To: [EMAIL PROTECTED]
>Subject: Using out.println to write on the browser - Doesn't Work !!!
>
>
>Hi,
>
>If the entered information by the user doesn't match with the information
>existing in the database then I wish to print a message on the browser to
>the end user which explains as given below.
>
>
>For Example:
>
>
>By using System.out.println ("The user name you provided is incorrect.");
>prints in the java console. (Works perfectly)
>
>
>By using out.println ("The user name you provided is incorrect.");
>gives an error. (Doesn't Work.)
>
>
>Can anybody help me how to do the same.
>
>
>Regards,
>Suresh Kumar
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html