这有效:
String address1 = HtmlUtil.escape(rs.getString("address1"));
...但我不想显示“null”。所以我尝试了这个,它不起作用:
String address1 = HtmlUtil.escape(rs.getString("address1") || "");
使用这个是最好的选择:?
String address1 = HtmlUtil.escape(rs.getString("address1"));
if (address1 == null) address1 = "";