Enumeration looks to heavy, because we have 1-2 parameters in most cases, so
use
If (getParameterValues() != null)
  parameter = getParameterValues()[0];

Dmitry.
----- Original Message -----
From: Alex Worden <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 18, 1999 12:34 PM
Subject: Re: getParameter for POST


>calling getParameterValues()[0] is a really bad idea - if there are not any
>parameters, you'll be dereferencing a null pointer and you'll get a
>NullPointerException.
>
>It would have been great if the servlet folks had used the Enumeration
>interface instead of an array of String.
>
>
>-----Original Message-----
>From: James Duncan Davidson <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>Date: Thursday, March 18, 1999 12:35 PM
>Subject: Re: getParameter for POST
>
>
>>> Isn't "getParameter()" deprecated?  I've been using "getParameterValues"
>>> for both GET and POST.  Works just fine.
>>
>>At one point it was, then we had a palace coup lead by some of the folks
>>in servlet land and it wasn't deprecated anymore as it's a *damn* useful
>call.
>>
>>getParameter returns the same value as getParamterValues[0]
>>
>>.duncan
>>
>>__________________________________________________________________________
_
>>To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
>>of the message "signoff SERVLET-INTEREST".
>>
>>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>>Resources: http://java.sun.com/products/servlet/external-resources.html
>>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to