• 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

hyperlinks + jsp

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 449
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic