Q:

How to Fetch data by clicking image

I have the following code in edit.jsp
<%
while (rs.next()) 
{
%>
<tr>
<TD><%=rs.getString(1)%></TD>  //for text box name
<TD><%=rs.getString(2)%></TD>  //for text box address
<TD><%=rs.getString(3)%></TD>  //for text box origin 
<td><a href="create.jsp"> <img src="images/editdetail.png"></a></td>
</tr>

while clicking the image/editdetail.png i am redirecting the page to create.jsp, where i have three text boxes("name", "address" and "origin").
how to get the getString value also getting displayed in the text box when i click the png image, so that i can edit the details.

A:

You could pass this as params as TJ mentioned. But if you think its kinda insecure, because the details are present in the URL, you could save the details as an object in the session. using session.setAttribute().
In the create.jsp, read the object against the key and populate the text boxes accordingly.
A usecase similar to your's is illustrated in this example :  http://www.jsptut.com/sessions.jsp
I believe, the create.jsp will submit the detials to another JSP. say... submit_details.jsp
in submit_details.jsp, after processing the details, do remember to remove the attribute from the session. 

