cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: woody: null instead of empty string if field left empty
Date Wed, 12 May 2004 17:13:50 GMT
On 12.05.2004 18:09, Hubert Trzewik wrote:

> I have a problem with woody.
> Let's say I store filled form in SQL DB.
> 
> On woody exit an XSP page is fired. Inside XSP SQL query is builded.
> 
> Let say form has 4 fields. We filled two first, and the 3rd and 4th we
> left empty.
> 
> SQL query I get in result is:
> INSERT INTO onetable VALUES ('filled field1', 'filled field2', 'null',
> 'null');
> 
> instead of:
> INSERT INTO onetable VALUES ('filled field1', 'filled field2', '', '');
> 
> How I can easy get rid off of those 'null's?

Woody returns Java null, not the String "null", so you can easily/safely 
do something like

String value == field.getValue();
if (value == null) {
     value = "";
}

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message