| Author |
When have no record in the field
|
feng fu
Greenhorn
Joined: Feb 24, 2004
Posts: 8
|
|
|
I have a problem about my jsp page. when the field 'Name' doesn't have any record,I use <input name="Name" type="text" id="Name" value="<%= ResultSet.getString("Name") %>">, in the IE, inside text box, it show 'null'. What I should do to make it doesn't show anything inside the text box
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
Well I would most certainly not be doing SQL on a JSP page or passing a result set to a JSP page, but the general problem is that when the result of a scriptlet expression is null, it translates to the string "null" in the output as you have discovered. One solution is to do something along the lines of: (assuming that the scripting variable 'whatever' is a String -- extrapolate to the approriate conersion if not)
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
feng fu
Greenhorn
Joined: Feb 24, 2004
Posts: 8
|
|
|
It works, thanks a lot
|
 |
 |
|
|
subject: When have no record in the field
|
|
|