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

hyperlinks + jsp  RSS feed

 
Sam Anjos
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presently have a html page with multiple links. A few (4) of these links should be passing through a login jsp page before accessing the appropriate form.
My question ... is there a way that I can find which link is being selected?
I don't want to have 4 copies of the same login jsp/bean pointing to 4 different forms, I should have one login jsp/bean pointing to 4 forms depending on which hyperlink was initialy selected.
Hyperlink1 Hyperlink2
| |
| |
V V
--- login ----
| |
| |
V V
form form
Any help would be appreciated,
Sam A.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can add parameter to your hyperlink e.g.
<a href="http://<hostname>:<port>/your.jsp?ref=target1>Target1</a>
<a href="http://<hostname>:<port>/your.jsp?ref=target2>Target2</a>
etc.
 
Vijay S. Rathore
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sam,
On every hyperlink update a hidden form element on your html page, and read it's value in the servlet/jsp.

Based on the hidden form value you can forword it to any desired form(s).
 
Sam Anjos
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you both for your help.
I ended up using both ways, initially rewriting the hyperlink with the info and then keeping it in a hidden html field.
Sam A.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!