| Author |
how to avoid displaying 'null' in jsp
|
Madhu Sudhana
Ranch Hand
Joined: Apr 16, 2006
Posts: 127
|
|
I am retrieving data from data base and displaying the same in a jsp in String format. but when there is no entry for the corresponding field it is getting displayed as null in the jsp. How can I avoid that ? I need to display an empty field if the corresponding value is null.
|
"And the trouble is, if you don't risk anything, you risk even more." -- Erica Jong.
|
 |
ankur rathi
Ranch Hand
Joined: Oct 11, 2004
Posts: 3829
|
|
Use if condition and put empty where it is null. FE,
|
 |
abhishek gowlikar
Greenhorn
Joined: Aug 17, 2006
Posts: 13
|
|
Here it is simple when try to retrive the Field from Database,But the Field is Empty Check the condition like if(object.variable == null) { object.variable=""; }
|
 |
Adeel Ansari
Ranch Hand
Joined: Aug 15, 2004
Posts: 2874
|
|
You can have a few utility methods defined in some utility class to get around this issue or anyother related issues. Or using JSTL is your best bet.
|
 |
 |
|
|
subject: how to avoid displaying 'null' in jsp
|
|
|