jQuery in Action, 3rd edition
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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="http://www.tangosol.com" target="_blank" rel="nofollow">www.tangosol.com</a><br /><a href="http://www.tangosol.com/coherence.jsp" 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() %>
I agree. Here's the link: http://aspose.com/file-tools
subject: Simple JSP question
It's not a secret anymore!