You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Nic Werner <ni...@link11.net> on 2003/08/01 18:07:55 UTC

Re: Handling null dates

Well, what I'm trying to nail down also is how empty values are passed
across a submit form.

I have a drop down, and one of the options is:
<option value=""> </option>
Which, if the name of the input is 'datemonth', then the GET says

handler.jsp?datemonth=

Now, when I have my handler jsp pick this up, will it take that as null or
empty? This is what trips up fmtDate and if someone knew what JSTL did with
this, I would appreciate it. If it was null, as someone mentioned earlier,
the spec would be able to handle it.

- Nic Werner

Link11
----- Original Message -----
From: "Narayan, Anand" <AN...@e-gatematrix.com>
To: "'Tag Libraries Users List'" <ta...@jakarta.apache.org>
Sent: Thursday, July 31, 2003 12:23 PM
Subject: RE: Handling null dates


> The problem I am encountering seems to be with the JDBC driver.
> Acc. to the release note for JSTL 1.0 on the jakarta site one should
> be able to use the EL ${null} for the value parameter of
> sql:param or sql:dateParam but some drivers do not support the
> underlying implementation by jakarta.
>
> Heres the exact text:
> Use of null with <sql:param> and <sql:dateParam>
> The Standard 1.0 taglib utilizes the
> PreparedStatement.setObject(parameterIndex, null) when specifying the
> <sql:dateParam value="${null}" type='date'/> or <sql:param value="${null}"
> /> actions. Not all JDBC drivers currently support the passing of null to
> the PreparedStatement.setObject() method. If you encounter a failure with
> your JDBC driver, please execute a SQL DML statement which does not
require
> <sql:param> or <sql:dateParam> to specify a null value for a given column.
>
>
> -----Original Message-----
> From: Siggelkow, Bill [mailto:bill.siggelkow@mirant.com]
> Sent: Thursday, July 31, 2003 3:12 PM
> To: 'Tag Libraries Users List'
> Subject: RE: Handling null dates
>
>
> Are you parsing the dates using <fmt:parseDate>?  If so, then according to
> the spec, the if the input value is null or "" the variable specifed by
var
> will be removed.  You could then use the empty operator to check for a
null
> value.  Hope this helps.
>
> -----Original Message-----
> From: Narayan, Anand [mailto:ANarayan@e-gatematrix.com]
> Sent: Thursday, July 31, 2003 11:27 AM
> To: 'Tag Libraries Users List'
> Subject: RE: Handling null dates
>
>
> Same issue here with null dates.
> I need to set the value of a date field to null.
> How can I create an object that equates to null?
> The JSTL spec for dateParam says that if the value equates to null
> the column will be set to null but i have not figured out how
> to create a null object in JSP.
> Any ideas??
>
> Thanks
> Anand Narayan
>
> -----Original Message-----
> From: Nic Werner [mailto:nic@link11.net]
> Sent: Wednesday, July 30, 2003 1:27 PM
> To: Tag Libraries Users List
> Subject: Handling null dates
>
>
> Greetings,
>    I have a form that has a lot of date fields, they represent dates
someone
> attempted to take a test.
>
> There are multiple sets of these for each attempt they have taken, but I
run
> into trouble if there is only one test attempt, meaning there are blank
> dates for the other attempts.
>
> Is there any way I can have the form send over the blank values and JSTL
> will just update the database with these blank values? I've tried to
detect
> if the date is empty and just set the variable to be updated to be blank
> with <c:set value="" var="datetaken"/>
> but I get invalid column type.
>
> Thanks,
>
> Nic Werner
>
> Link11
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org