I'm seeing some weird behaviour with parameters that are passed to servlets
as blank strings, ie in a URL such as
http://machine/zone/servlet?param1=&param2=. These parameters end up having
the value "null" (ie a 4-character string) rather than either a blank
string or a null pointer, which is what I would expect.

Here's the code -

Enumeration parmNames = inRequest.getParameterNames();

while ( parmNames.hasMoreElements() )
{
        String key = (String) parmNames.nextElement();

        String value = inRequest.getParameter( key );

        // value == "null" here
        // in case where parameter is passed as ?name=&name=value
}

Any ideas anyone? Thanks in advance.




----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to