On Thu, Jun 17, 1999 at 12:33:21PM -0800, Java List wrote:
> Here's one of the error handeling method:
> ---------
> public static String getMultipleErrorsAsString(Vector error) {
>
> PrintWriter writer = new PrintWriter(System.out);
[snip]
> return writer.toString(); // <-- Why does this return a hash code
> rather than a String?
> }
Because PrintWriter.toString() isn't implemented.
When you created the PrintWriter, you directed it to
System.out -- so all of the text you're sending to the PrintWriter
is going there. When you call toString(), you're getting the
Object.toString() result.
I think you want java.io.StringWriter -- it appears it will
work the way you want.
--
Robert Crawford [EMAIL PROTECTED]
http://www.iac.net/~crawford
___________________________________________________________________________
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