Received: (qmail 24881 invoked by uid 2012); 28 Dec 1998 23:15:35 -0000 Message-Id: <19981228231535.24880.qmail@hyperreal.org> Date: 28 Dec 1998 23:15:35 -0000 From: Hans Bergsten Reply-To: hans@gefionsoftware.com To: apbugs@hyperreal.org Subject: NullPointerException in JServSSI.getParameter(String name) X-Send-Pr-Version: 3.2 >Number: 3601 >Category: mod_jserv >Synopsis: NullPointerException in JServSSI.getParameter(String name) >Confidential: no >Severity: serious >Priority: medium >Responsible: jserv >State: closed >Class: sw-bug >Submitter-Id: apache >Arrival-Date: Mon Dec 28 15:20:01 PST 1998 >Last-Modified: Sun Sep 19 14:54:40 PDT 1999 >Originator: hans@gefionsoftware.com >Organization: >Release: Apache 1.3.3 >Environment: JServ 1.0b1 1998-12-19 and JServ-SSI 1.0 Windows NT 4.0 SP3 JDK 1.1.6 >Description: JServSSI.getParameter(String name) throws a NullPointerExecption if req.getParameterValues(name) returns null (it does if the page is requested without parameters). >How-To-Repeat: Use the tag without tags to invoke a servlet on a page requested without any request parameters. >Fix: The following modified version of the method works: public String getParameter(String name) { String value = (String) params.get(name); String rvalues[] = req.getParameterValues(name); // Added null test below if (rvalues == null) return value; return (value != null) ? value : (rvalues.length > 0 ? rvalues[0] : null); } >Audit-Trail: State-Changed-From-To: open-closed State-Changed-By: jon@clearink.com State-Changed-When: Sun Sep 19 14:54:40 PDT 1999 State-Changed-Why: lots of new versions. i doubt that this is still an issue. >Unformatted: [In order for any reply to be added to the PR database, ] [you need to include in the Cc line ] [and leave the subject line UNCHANGED. This is not done] [automatically because of the potential for mail loops. ] [If you do not include this Cc, your reply may be ig- ] [nored unless you are responding to an explicit request ] [from a developer. ] [Reply only with text; DO NOT SEND ATTACHMENTS! ]