Empty fields are realy sent. The only fields that are not sent are fields
with the "disable" attribute and buttons that were not clicked. But what I
have seen with empty fields, getParameter() does not return null but really
returns an empty string...

Anyway if you have any feedback from SUN, please give us some news!
Pascal

-----Original Message-----
From: Mark Brouwer [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 22, 1999 11:33 AM
To: [EMAIL PROTECTED]
Subject: Re: Annoying thing in the Java specifications


Richard Vowles wrote:

>
> If you check your GET that is sent via HTTP, you will notice that
> fields that are empty are not actually sent over - meaning that the
> setParameter doesn't know that it has been set to empty. The only
> thing it could do is iterate over the properties setting them to null
> (string) or something else - but that is as
> messy as the solution.
>
>Pascal Houde wrote:
>
> > I don't understand either why it was done like that. Even if the
> > parameter is empty it should try to set the property to which
> > .valueOf(String) is successful. So properties accepting a
> > B/boolean or String(of course) or C/char should be set by the
> > jsp:setProperty action. "Setter" method accepting an int would be
> > left unchanged.
> >
> > Can somebody clears out why it hasn't been done like that.
> > I don't see why empty parameters can't be used to set an object
> > property.
>

Well I just checked this and in case of a form with POST or GET as
action all the empty fields are sent to the the servlet/JSP, at least
with Navigator and Explorer. I haven't checked the offical standards,
but it seems all fields are sent with the GET and POST command. If you
check the value of the empty field with
aRequest.getParameter(parameter), null will be returned. So a servlet
knows a field has been cleared and therefore should do something with
that information.

The current JSP specification is terrible at this point. In our current
JSP application we are working as with servlets in the old days. Parsing
the request ourselves and setting the properties, corresponding with the
empty fields, on our own.

I think that for String properties you can say if somebody clears a
field in a browser, the property has to be cleared in the underlying
application as well, passing it an empty String. Maybe an empty field
isn't a valid state for your application, but you have to know for
validation, setting of default value, etc. Leaving a property to its
original state is unacceptable in most real live situations, at least
that is what we think.

As I was the original sender of this problem, I send my thoughts about
this subject to the JSP feedback address and the JSP specification
address, but no response from them yet :-(
--
Mark Brouwer
Virgil B.V.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
For JSP FAQ, http://www.esperanto.org.nz/jsp/jspfaq.html

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
For JSP FAQ, http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to