Also when you write something outside the <% %> it is displayed the way you write (HTML style).
So when you write this:
<a href="viewdata.jsp?value1="+
sth+">"+ . . .
It will not concat. It is not java and it is not a String to concat it.
If you want to display the value of a variable do this:
<%= rs.getString(1)%>
It will put whatever value it has as "part" of the HTML page.
So might want to write this:
<a href="viewdata.jsp?value1=<%= rs.getString(1)%>"><%=rs.getString(1)%></a>
No semicolon inside the <%= %> and notice the: "" of the href, as well as where the <> opens and closes:
<a href=
"viewdata.jsp?value1=
<%= rs.getString(1)%>" >
<%=rs.getString(1)%>
</a>
Also make sure to read peter_budo's post and follow his advice. My post was just for informative purposes. It is not correct to open database connections inside a jsp, and use the ResultSet that way to create a link
Last edited by javaAddict; Jan 5th, 2009 at 6:57 am.