Passing values to a JSP file

Help!

This is a very trivial and simple problem but stupid me couldn't figure out. I am developing a web interface with a database. I retrieved some records with a recordset. Now I am passing the id value to the next jsp file. This is what my code looks like:

<td>

<a href="someDetail.jsp?id=" + ""><%= results.getString("id") %>""><%= results.getString("name") %>

</a>

</td>

Once the screen comes up with all the records and when I click one particular record it goes to the someDetail.jsp file but it is not taking the id with it. In the someDetail.jsp screen the URL looks like this.

http://localhost/someData/someDetail.jsp?id=

What am I missing here?

Sue

[762 byte] By [srajaman2a] at [2007-9-19]
# 1

> <a href="someDetail.jsp?id=" + ""><%=

&gt; results.getString("id") %>""><%=

&gt; results.getString("name") %>

Why not just assign a variable to the id? ie.

<% while (results.next()) {

String someId = results.getString("id");

%>

<td><a href="someDetail.jsp?id=<%=someId%>">Detail Page</a></td>

<% } %>

Hope this helps a bit.

abrattya at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2
It seems you ahve included some additional quotes in the attribute href.Rewrite that to<a href="someDetail.jsp?id=<%= results.getString("id") %>">
johnvinoda at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 3
Thanks! That worked.Sue
srajaman2a at 2007-7-8 > top of java,Enterprise & Remote Computing,Web Tier APIs...