RE: URGENT: Null Strings in Websphere

2002-02-14 Thread Andre Beskrowni

how are you storing your data?  is it stored in a database using jdbc?  and
if so, are you constructing your insert statements as strings and directly
appending the values onto the string rather than using bind values?  i've
seen this problem come up before, and it's always been the case that people
aren't using jdbc the way it's meant to be used.  their inserts were always
done like this:

String insert = "insert into customer " +
   "(customer_id, name, address) " +
   " values (customer_seq.nextval," +
   myCustomer.getName() + ", " + myCustomer.getAddress() + ")";

PreparedStatement insertStmt = connection.prepareStatement(insert);
insertStmt.executeUpdate();

instead of the correct way, which would be like this:

String insert = "insert into customer " +
"(customer_id, name, address) " +
"values (customer_seq.nextval, ?, ?);
PreparedStatement insertStmt = connection.prepareStatement(insert);
insertStmt.setString( 1, myCustomer.getName() );
insertStmt.setString( 2, myCustomer.getAddress() );
insertStmt.executeUpdate();

if you think this is the source of your problem, please read the java
tutorial chapter on JDBC asap.

ab


-Original Message-
From: Phillips, George H. [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 3:20 PM
To: 'Struts Users Mailing List'
Subject: RE: URGENT: Null Strings in Websphere


We had a similar problem.  Although we were actually getting spaces back
from our DB, we were seeing "null" displayed on our jsp's.  We fixed it by
explicitly initializing our String fields in our result beans to " " rather
than letting them default to null.  I don't know *why* this worked, since
you'd think the original null values would be overlaid when a field's setter
was called, but for whatever reason, it solved the problem...
George Phillips
University of Miami
[EMAIL PROTECTED]

> -Original Message-
> From: Dave J Dandeneau [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 10:39 AM
> To: Struts Users Mailing List
> Subject: URGENT: Null Strings in Websphere
> 
> 
> Whenever we have a String value in our forms, and the value 
> is not set (""), it is getting sent back to the jsp as 
> "null". By "null" I mean the actual string, and not an empty 
> object. This is making validation of these fields fail. Has 
> anyone seen this and found a work around.
> 
> Thanks,
> Dave Dandeneau
> 
> --
> To unsubscribe, e-mail:   
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: 
> <mailto:[EMAIL PROTECTED]>
> 

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

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




RE: URGENT: Null Strings in Websphere

2002-02-12 Thread Phillips, George H.

We had a similar problem.  Although we were actually getting spaces back
from our DB, we were seeing "null" displayed on our jsp's.  We fixed it by
explicitly initializing our String fields in our result beans to " " rather
than letting them default to null.  I don't know *why* this worked, since
you'd think the original null values would be overlaid when a field's setter
was called, but for whatever reason, it solved the problem...
George Phillips
University of Miami
[EMAIL PROTECTED]

> -Original Message-
> From: Dave J Dandeneau [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 10:39 AM
> To: Struts Users Mailing List
> Subject: URGENT: Null Strings in Websphere
> 
> 
> Whenever we have a String value in our forms, and the value 
> is not set (""), it is getting sent back to the jsp as 
> "null". By "null" I mean the actual string, and not an empty 
> object. This is making validation of these fields fail. Has 
> anyone seen this and found a work around.
> 
> Thanks,
> Dave Dandeneau
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: URGENT: Null Strings in Websphere

2002-02-12 Thread Keith

wild guess -  a problem in your deployment is causing something to not be found
resulting in null not "".
Maybe diff. versions of something? Do let us know if you crack it.

Keith, 

--- Dave J Dandeneau <[EMAIL PROTECTED]> wrote:
> We develop using tomcat 3.2.1 and then deploy to Websphere, and we only
> see this behavior on websphere (Websphere 4.0). We can initialize all
> the values to "", but I am curious why the two are acting differently. 
> 
> Thanks for the help,
> dave dandeneau
> 
> -Original Message-
> From: Olivier Dinocourt [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 12, 2002 10:43 AM
> To: Struts Users Mailing List
> Subject: Re: URGENT: Null Strings in Websphere
> 
> 
> I might be wrong, but it seems to me that this standard Java
> behavior
> When your String is null and you try to print it, it displays the String
> value "null".
> 
> A workaround might be to force all empty Strings to be "" instead of
> null...
> 
> - Original Message -
> From: "Dave J Dandeneau" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Tuesday, February 12, 2002 4:38 PM
> Subject: URGENT: Null Strings in Websphere
> 
> 
> Whenever we have a String value in our forms, and the value is not set
> (""),
> it is getting sent back to the jsp as "null". By "null" I mean the
> actual
> string, and not an empty object. This is making validation of these
> fields
> fail. Has anyone seen this and found a work around.
> 
> Thanks,
> Dave Dandeneau
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

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




RE: URGENT: Null Strings in Websphere

2002-02-12 Thread Dave J Dandeneau

We develop using tomcat 3.2.1 and then deploy to Websphere, and we only
see this behavior on websphere (Websphere 4.0). We can initialize all
the values to "", but I am curious why the two are acting differently. 

Thanks for the help,
dave dandeneau

-Original Message-
From: Olivier Dinocourt [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 10:43 AM
To: Struts Users Mailing List
Subject: Re: URGENT: Null Strings in Websphere


I might be wrong, but it seems to me that this standard Java
behavior
When your String is null and you try to print it, it displays the String
value "null".

A workaround might be to force all empty Strings to be "" instead of
null...

- Original Message -
From: "Dave J Dandeneau" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 4:38 PM
Subject: URGENT: Null Strings in Websphere


Whenever we have a String value in our forms, and the value is not set
(""),
it is getting sent back to the jsp as "null". By "null" I mean the
actual
string, and not an empty object. This is making validation of these
fields
fail. Has anyone seen this and found a work around.

Thanks,
Dave Dandeneau

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





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


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




Re: URGENT: Null Strings in Websphere

2002-02-12 Thread Olivier Dinocourt

I might be wrong, but it seems to me that this standard Java behavior
When your String is null and you try to print it, it displays the String
value "null".

A workaround might be to force all empty Strings to be "" instead of null...

- Original Message -
From: "Dave J Dandeneau" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 12, 2002 4:38 PM
Subject: URGENT: Null Strings in Websphere


Whenever we have a String value in our forms, and the value is not set (""),
it is getting sent back to the jsp as "null". By "null" I mean the actual
string, and not an empty object. This is making validation of these fields
fail. Has anyone seen this and found a work around.

Thanks,
Dave Dandeneau

--
To unsubscribe, e-mail:

For additional commands, e-mail:






--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: URGENT: Null Strings in Websphere

2002-02-12 Thread Galbreath, Mark

I had the same problem about a month ago (and a colleague had this problem
just yesterday) and someone posted a solution either here or on
servlet-interest.  Search the archives on both groups.

Mark

-Original Message-
From: Dave J Dandeneau [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 10:39 AM
To: Struts Users Mailing List
Subject: URGENT: Null Strings in Websphere


Whenever we have a String value in our forms, and the value is not set (""),
it is getting sent back to the jsp as "null". By "null" I mean the actual
string, and not an empty object. This is making validation of these fields
fail. Has anyone seen this and found a work around.

Thanks,
Dave Dandeneau

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: