Per the spec:

"The conversion to String is done as in the println methods, i.e. the toString method of the object is used for Object instances, and the primitive types are converted directly."

And in the javadocs for print(String):
Print a string. *If the argument is null then the string "null" is printed.*


-Tim

Michael Molloy wrote:

Thanks for the pointer. I have not investigated JSTL, and I will look
into it further.

Can anyone give me a link that explains the reasons behind this
behaviour? Now that I'm aware that it can't be turned off, I'm very
curious as to why it was coded this way.

Thanks,
--Michael


-----Original Message-----
From: Tim Funk [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 12, 2005 7:55 AM
To: Tomcat Users List
Subject: Re: Null printed in jsp getProperty fields


There is no setting to turn this off.

[But if you use JSTL - null get supressed for you.]

-Tim

Michael Molloy wrote:


Hello everyone. I can't imagine that this isn't a question that has been asked a great many times, but I can't find the answer anywhere.

We're using multiple tomcat 4.1.30 servers in a production environment


for a commercial website, and we would like to move up to the latest stable version. However, when testing our application in tomcat 5.0+, we have noticed that jsp pages that use the <jsp:getProperty /> method


to display session data print the word "null" in every field that has a null value.

Although I haven't read about this, I'm guessing it is part of the Sun's application server standard. I've been told that WebLogic does the same thing, but that there is a configuration setting to repress displaying the word null.

Is there such a setting for tomcat? If not, what is the best way to keep from printing "null" in every field that has a null value? I know


we could do it through javascript, but it just seems like a change this big, after years of not having this behaviour, there must be some


way to prevent it from happening at the application server level.

Can someone point me in the right direction? I've googled for the answer, but any search with "null" and "tomcat" in it returns a lot of


pages about unrelated problems.



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to