I have following code in one of my JSPs.
<% if(rsmatches!=null){%>
<table>
<tr>
<td class="captions">Match</td>
<td>
<select>
<%
while(rsmatches.next()){
%>
<option value="<%out.print(rsmatches.getString("matchid"));%>"><%out.print(rsmatches.getString("matchid"));%> - <%out.print(rsmatches.getString("team1name"));%> vs <%out.print(rsmatches.getString("team2name"));%></option>
<%}%>
</select>
</td>
</tr>
</table>
<%} else{%>
<h1>No Result</h1>
<%}%>
So rsmatches is the resultset and when it is not null it gives the output as I expected, but when the Resultset has no results, Instead of showing