This is the expected operation of a PrintWriter. Read the JavaDoc for
java.io.PrinterWriter.print(String s).
print
public void print(String s)
Print a string. If the argument is null then the string "null" is printed.
Otherwise, the string's characters are converted into bytes according to the
platform's default character encoding, and these bytes are written in
exactly the manner of the write(int) method.
Parameters:
s - The String to be printed
> -----Original Message-----
> From: Oren Deri, Nice-Eye [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, March 08, 2001 4:30 AM
> To: [EMAIL PROTECTED]
> Subject: Problem with JspWriterImpl
>
>
>
> Hi,
>
> when printing in jsp some String that is null (String str = null;)
> the output html is the string "null".
> Look at the code of JspWriterImpl.print(String s)
>
> public void print(String s) throws IOException {
> if (s == null) {
> s = "null";
> }
> write(s);
> }
>
> why did you return "null"? I changed it to "" insted of "null"
> and it works
> just fine.
> :
>
> public void print(String s) throws IOException {
> if (s == null) {
> s = "";
> }
> write(s);
> }
>
> My questions:
>
> Is my change can hurt the tomcat operation?
> Why did you return "null" and not ""
> (the original software is on weblogic but we moved it to tomcat which have
> better performance, in weblogic they return "" and not "null") ?
>
>
> 10x
>
> Oren, Israel
>
>
>
> -----------------------------------------
> Oren Deri
> Cellular: 972-53-555579
> Mail: [EMAIL PROTECTED]
> ------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]