Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make the values taken from the database as a link

 
Santhana Lakshmi.S
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rs.getString("link")


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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic