aspose file tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply 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: 14672
    
  11

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://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to make the values taken from the database as a link
 
Similar Threads
calendar
how to change image after a click
Logic for dealing with resultSet
Whats wrong with this line of code???
Displaying uploaded images in jsp