Say a text box takes value from Transfer Object as below in a jsp:
<INPUT TYPE="text" NAME="test" ID="test" value="<%=testTO.getTest()%>">
However, if getTest returns null, null will be displayed.
How to use ? : with scriptlet so that if the value is null, blank is displayed else the value returned from TO.
use it like this for printing blank:
<INPUT TYPE="text" NAME="test" ID="test" value="<%= ((testTO.getTest()==null)?"":testTO.getTest()) %>">
ok add this condition
(&& testTO.getTest().length() == 0)
if it is already returning a String if not you must use this
(&& testTO.getTest().toString().length() == 0)
<INPUT TYPE="text" NAME="test" ID="test" value="<%= ((testTO.getTest()==null && testTO.getTest().length() == 0)?"":testTO.getTest()) %>">