Hamid:
I think you may have to approach the problem differently. Here's what I suggest:
1. Create a class called Person with (at least the) attributes "Name", "Age",
and "Address".
2. When you read all the info using JDBC, populate a Vector called say
"allPeople", each member of which is an object of class Person.
3. Display the info in a jsp (instead of in an html page) using the above Vector
as follows:
Give the links a url which will correspond uniquely to the particular item in
the Vector, even as simply as its position in the Vector, as in:
for (int i=0; allPeople.size(); i++){
Person ithPerson = (Person)allPeople.elementAt(i);
ithUrlString = "/servlet/myServlet?vectorPosition=" + String.valueOf(i);
%>
//Now display the url, as well as all info abt ith person in the Vector in
the jsp:
<TR>
<TD><A HREF="<%=ithUrlString%>"><%=ithPerson.getName()%></A></TD>
<TD><%=ithPerson.getAge()%></TD>
<TD><%=ithPerson.getAddress()%></TD>
</TR>
<%
}
%>
Now when the user clicks on any of the links, then you can read the position in
the Vector and if you had populated your Vector already with all the attributes
you want to display (in the second jsp) already (this is why you would want to
decide what attributes Person should have in the first place..), maybe another
trip to the database would not be necessary... (But that is something you have
to decide on the basis of what you want to display.)
Best wishes!
Geeta
Hamid Farooqui wrote:
> Hi All
>
> Here is a table
>
> Name Age Address
> --------- ------ ------------
>
> I use JDBC and get all the ppl listed on the html page
> Now the NAME column has hyperlink to PropertyServlet.class
> The PropertyServlet would give me details of the property belonging to the
> person who was clicked above
>
> Q: How do I pass the clicked Name value to PropertServlet, so that I can use
> it in my select statement to specify the where clause?
>
> TIA
>
> Hamid
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html