wood burning stoves 2.0*
The moose likes JSP and the fly likes How to make the values taken from the database as a link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How to make the values taken from the database as a link" Watch "How to make the values taken from the database as a link" New topic
Author

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

Santhana Lakshmi.S
Ranch Hand

Joined: Aug 16, 2005
Posts: 82
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

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.


[My Blog]
All roads lead to JavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make the values taken from the database as a link