Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic