Serge Knystautas wrote:

Jason Lea wrote:

So looking at this:

<sql:param><c:out value="${param.time}" /></sql:param>


Unless you're using c:out to escapeXml your request parameter, or as you say, prevent nulls from entering the database, I'm not sure why you would do this. Just do

<sql:param value="${param.time}" />

Then if param.time is null, it stores null in the database.

Rick explained that param.time is always passed as a parameter (as it is a form field). But it is sometimes empty, which gives him an empty string. So param.time will never be null.


What he wants is to store null in the database when the form field is empty eg when param.time is an empty string.

So when param.time is an empty string:

<sql:param value="${param.time}" />

tries to store an empty string (which he doesn't want)

and this

<sql:param><c:out value="${param.time}" /></sql:param>

stores a null (which he does want)

But Rick wants to know if this is the intended behaviour, because this looks like it should do the same as the first one. Can he depend on this always working, or might this bug(?) get fixed in future and stop his code working.

--
Jason Lea


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to