How to make the values taken from the database as a link
posted 9 years ago
HI, Im doing a project in jsp.In that while downloading images, the image link will stored in the database and also frm one file im displaying all the links stored in the database.Now i want to make all those values as links i.e.,if anyone clicks on that link it has go to the respective page. I tried with the following code:
<a href="<%=rs.getString("link")%>"> <% out.println(rs.getString("link"));%> </a> But this is not working. can anyone tell me how to do this? And also After adding the links in the database i want to display the respective image. With my codings im able to add the link in the database but after addding the corresponidng image is not displaying. I tried with the following code:
After insert into query i stored the link value in a string name link response.sendredirect("link");this is not working can anyone help me with this? thanx a lot
It won't solve your problem, but I'd like to give you an advice. Do not do the above code in JSP. Prepare a list of links in a servlet, put the list in the request scope and forward to your JSP. It will then be easy to display the list in JSP.