tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Gaston Alvarez" <gast...@tournet.com.ar>
Subject RE: Problem with JspWriterImpl
Date Sun, 11 Mar 2001 01:26:44 GMT
Well, if you changed the code and it works for you, it is fine.
Now, the main diference is that "" hides the error while "null" does not. I
mean "" is not equal to null.
Also, printing "null" follows better the java philosophy. Remember to make
the change each time you install a new version. But I think that it is a
better idea to modify your code so you controll if it is a null.

    out.print( (yourVariable == null) ? "" : yourVariable );

This way it will be fully portable.


Chau,

Carlos Gaston Alvarez

ps: someone please check that peace of code. I mean, java core classes
should be doing this automatlically for us. I think we are duplicating code.


----- Original Message -----
From: Oren Deri, Nice-Eye <orendi@nice-eye.com>
To: <tomcat-dev@jakarta.apache.org>
Sent: Thursday, March 08, 2001 7:30 AM
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: oren@orenderi.com
> ------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-dev-help@jakarta.apache.org


Mime
View raw message