Henric Larsson wrote:
>
> I would like to add another one:
>
> request.getParameter(String)
>
> what should it return if the request came from a POST
> but the value was not filled out in a form, also if the
> parameter is present in a GET but no value is specified
> for it.
>
> I keep checking my parameters for a null and then for a
> zero length String, I think the spec. should specify this
> to ease the code up a bit.

For parameters that are passed but without a value, getParameter()
returns an empty string.

I wrote a ParameterParser class that simplifies parameter parsing,
and as part of that it allows you to treat null and "" as the same.
See http://www.servlets.com/resources/com.oreilly.servlet.

-jh-

--
Jason Hunter
[EMAIL PROTECTED]
Book:    http://www.servlets.com/book
Article: http://www.javaworld.com/jw-12-1998/jw-12-servletapi.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