tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jason Lea <ja...@kumachan.net.nz>
Subject Re: Fw: [OT]Re: <sql:param> null weirdness BACK ON TOPIC
Date Wed, 20 Aug 2003 03:43:31 GMT
Rick,

Perhaps you could try this:

<sql:update>
     INSERT INTO myTable VALUES ( ? )
     <fmt:parseDate value="${param.time}" var="myTime" type="both" />
     <sql:dateParam value="${myTime}" />
</sql:update>

You might have to give parseDate a pattern or dateStyle/timeStyle to 
parse correctly.  Apparently the sql:dateParam is supposed to be used 
for DATE, TIME or TIMESTAMP columns.

fmt:parseDate will check for null and empty values and remove myTime 
from scope.  I hope that means myTime will be null when param.time is an 
empty string.


-- 
Jason Lea


Mime
View raw message