Hey all,
Just wondering would anybody know how do I click on any hyperlink (which is records from the database displayed as hyperlink) that i'm brought to the desired page. Here is my code, where database returns all the records to the
JSP page as hyperlinks. But what happens at the moment is, whichever link in the table is clicked, u are brought to the same page ('ProductList.jsp'), while i want different pages for different links. I hope this isnt too confusing! Thank you!
<TABLE align ="centre" border= "5">
<TR>
<% for(int i=1;i<=rs.getMetaData().getColumnCount();i++)
{
%>
<TD><FONT size=5 FACE="Arial"></FONT>
<%= rs.getMetaData().getColumnName(i) %>
</TD>
<% } %>
</TR>
<% while (rs.next())
{ %>
<TR BGCOLOR="#ffff00">
<% for(int i=1;i<=rs.getMetaData().getColumnCount();i++){ %>
<%if (i==3){ %>
<TD><a href="ProductList.jsp?id=<%= rs.getString("categoryId")%>"><%=rs.getString("name")%><%=rs.getString("description") %></a></td>
<% } else { %>
<TD><%= new
String(rs.getString(i)) %></TD>
<% }
}%>
</TR>
<% } %>
</TABLE>