Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pass values using href in JSP

 
Mehak Daani
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi...
I have this code where my callid is a hyper link ..... to another jsp ..... the values of the callid comes from the database .... like calls.getInt("callid)"; ...................
Now my quest is that suppose there are 5 callid ... like 1 2 3 4 5 ... when i click on the 5th callid ... i want the hyperlink to pass the value 5 to another jsp ... where i'll be executing a query based on the 5th callid .... ...
So i have 2 questions:
1. How do i pass the dynamic value through hyper link ...
2. How do i retreive that value in another Jsp.
Please help me out on this one...!!!
Thanx
:roll:
Currently my code for the callid looks like this:
<td width="8%"><a href="somepage.jsp"><%=calls.getInt("callid")%></a></font>
 
Kevin Jones
Author
Ranch Hand
Posts: 39
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the first JSP use
<td width="8%"><a href="somepage.jsp?id=<%=calls.getInt("callid")%>"><%=calls.getInt("callid")%></a></font>
this should give you
<a href="http://someserver/somepage.jsp?id=5>5</a>
then in somepage.jsp use
<% request.getParamater("id"); %>
 
Mehak Daani
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA AAAAAAAAAAAAAAAA LOOOOOOOOTTTTTTTT
IT WORKED ...!!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64171
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Mehak!
As you have seen, you'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Forum Bartender
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic