Bug #522
closedNullPointer exception if Request doesn't specify a value for "action" parameter
0%
Description
If Request doesn't specify a value for the "action" parameter, Tomcat throws a
NullPointer exception.
Example:
Since the status bar has been added to Morpho (see bug #358), Morpho now tries
to connect to Metacat periodically to test if a connection is available. Each
time a connection is attempted (with no "action" specified), a nullpointer
exception appears in the tomcat output window.
Notes:
When metacat servlet was originally written, the HTTPRequest functionality was
originally buggy in tomcat, so as a workaround, request data was passed to
other methods using an array. When an "action" parameter is not passed to the
servlet in the request, the resulting array has zero length, so the method
that receives it throws a nullpointer exception.
A short-term fix would therefore be to check for a missing "action" value
and/or zero-lenght arrays; however, a better long-term fix would be to re-
write the servlet to pass references to the HTTPRequest object instead of
arrays.