I did something pretty stupid by having an Object.toString() method return a null.

When I tried to print that object using org.apache.jasper.runtime.JspWriterImpl.print(Object o) I received a NullPointerException. This is because the print method uses String.valueOf(Object o) method to convert the value into the null object and then calls JspWriterImpl.write(String s). This write method tries to get the length of this null string and a null pointer is thrown.

Now I know that this is a programming mistake, but it would have been nicer if a more specific error message was thrown. This can be easily accomplished by adding a check to the print(Object o) method that checks the result of String.valueOf().

Unfortunately, the Jsp 2.0 specification does not address this issue. The print(Object o) is not documented to throw a NullPointerException, only an IOException.

Any comments?

-Trav



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



Reply via email to