Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading a JSP word that is clicked on  RSS feed

 
Reuben Fields
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to be able click on one word from a list of three options from the database and have the details about just that one word appear....do i need to do something like...

<a href="servicedetails.jsp?"+name+><%

<a href="servicedetails.jsp">


<%
String county_name = result.getString(1);
out.print("");
out.println(county_name);
String service_name = result.getString(2);
out.print("Service: ");
out.println(service_name);
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it depends on how you want your details to appear. if it is in another window then you can use the <A href >.

by the way the correct usage for adding parameters to the existing url is
?name=<%= name %>

check it out and clarify further if need be.
 
Reuben Fields
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah it is another window. So when three values are pulled back from the database, i want to be able to click on one of them and just have the details corresponding to that service_name appear. When i put and <a href> before the String it makes all the results a link to the same page and it pulls all their details back, but thats not what i want.

I'll try that anyway thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!