• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pass values using href in JSP

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Author
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THANKSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSA AAAAAAAAAAAAAAAA LOOOOOOOOTTTTTTTT
IT WORKED ...!!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Nothing up my sleeve ... and ... presto! A tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic