Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to pass value to jsp through hyperlink  RSS feed

 
neeti mehndiratta
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two links. And i want to open same jsp using those links but the jsp should have different values when opened through different links.

e.g
<a href="a.jsp">one</a>
<a href="a.jsp">two</a>

here on clicking one and two, a.jsp should open but it should have different content depending upon, whether opened through link "one" or "two"
 
Neha Agarwal
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Send the link with a parameter as
<a href="a.jsp?value=a">
<a href="a.jsp?value=b">

and in a.jsp retrieve the parameter using request.getParamter(value).If the value is a then display a part of jsp else the second part
 
aatish pandya
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Neha,

I wanted to pass a value via href, but couldn't find a positive answer from my Faculty, you solved my prob. Thanks.
 
Lekshmanan Suresh
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[quote=aatish pandya]Thanks Neha,

I wanted to pass a value via href, but couldn't find a positive answer from my Faculty, you solved my prob. Thanks.[/quote]

Thanks Neha, me also searching for same it works fine
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!