From cocoon-dev-return-32542-apmail-xml-cocoon-dev-archive=xml.apache.org@xml.apache.org Fri Nov 01 11:36:02 2002 Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 3421 invoked by uid 500); 1 Nov 2002 11:36:01 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 3394 invoked from network); 1 Nov 2002 11:35:54 -0000 From: Ivan Mikushin Organization: OpenMechanics.net To: cocoon-dev@xml.apache.org Subject: a patch for a NullPointerException in org.apache.cocoon.environment.http.HttpRequest Date: Fri, 1 Nov 2002 16:38:29 +0500 User-Agent: KMail/1.4.3 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_50BW0YKDP3PZL75E1Y1B" Message-Id: <200211011638.29993.ivan@openmechanics.net> X-AntiVirus: checked by AntiVir MailGate (version: 2.0.1.6; AVE: 6.16.0.0; VDF: 6.16.0.11; host: mail.net-burg.net) X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --------------Boundary-00=_50BW0YKDP3PZL75E1Y1B Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: quoted-printable Hi! There is a bug in org.apache.cocoon.environment.http.HttpRequest: method getParameterValues( String name ) throws NullPointerException if=20 HttpServletRequest.getParameterValues(name) returns null.=20 This happens if, for example, a web application expects a form to submit=20 several fields with the same name, but it doesn't (or when these inputs a= re=20 cleared checkboxes). --=20 Ivan Mikushin, OpenMechanics.net --------------Boundary-00=_50BW0YKDP3PZL75E1Y1B Content-Type: text/x-diff; charset="koi8-r"; name="HttpRequest.java.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="HttpRequest.java.diff" --- HttpRequest.java Fri Nov 1 15:33:09 2002 +++ HttpRequest.java Fri Nov 1 16:06:30 2002 @@ -297,6 +297,7 @@ } private String decode(String str) { + if( str == null ) return null; try { if (this.container_encoding == null) this.container_encoding = "ISO-8859-1"; @@ -314,6 +315,7 @@ public String[] getParameterValues(String name) { String[] values = this.req.getParameterValues(name); + if (values == null) return null; if (this.form_encoding == null) { return values; } --------------Boundary-00=_50BW0YKDP3PZL75E1Y1B Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org --------------Boundary-00=_50BW0YKDP3PZL75E1Y1B--