File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Simple JSP question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Simple JSP question" Watch "Simple JSP question" New topic

Simple JSP question

Anurag Saxena

Joined: Oct 29, 2002
Posts: 13
This is my jsp page that contains the following:
<td Width=20%><%= kp.getSerialNo() %></td>
<td Width=20%><a href="TransactionRecord.jsp?serialNo=kp.getSerialNo()">Transaction Record</td>

I want to call another JSP(TransactionRecord.jsp) via hyperlink click. How do I pass the
value of "kp.getSerialNo()" ? The way I am doing is not working.
Rob Misek
Ranch Hand

Joined: Sep 24, 2002
Posts: 41
Hi Anurag,
One way to do this is to build the String first and then fill in the "a href".
String sUrl = "TransactionRecord.jsp?serialNo=" + kp.getSerialNo();
<a href="<%=sUrl%>">
I think that should work.

<a href="" target="_blank" rel="nofollow"></a><br /><a href="" target="_blank" rel="nofollow">Coherence:</a> Easily share live data across a cluster!
Bhupinder Dhillon
Ranch Hand

Joined: Oct 12, 2000
Posts: 124
Or you could try putting the bean method call in an expression tag <%= kp.getSerialNo() %>
It is sorta covered in the JavaRanch Style Guide.
subject: Simple JSP question
It's not a secret anymore!