This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes HTML and Servlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "HTML and Servlets" Watch "HTML and Servlets" New topic
Author

HTML and Servlets

Divya Kamath
Greenhorn

Joined: Feb 17, 2006
Posts: 9
I have a servlet which provides a hyperlink to another servlet in which processing pertaining to the hyperlink in the former takes place.Each hyperlink is dynamically generated and is given a unique identity so that it can be acessed in the processing servlet.How do i set a unique identification in the <a href> tag in the first servlet and how can i access the same in the target servlet?
Thanks,
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

If you generate a timestamp and embed it in the url as a querystring variable, you can retrieve it with request.getParameter("timestamp");



Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Divya Kamath
Greenhorn

Joined: Feb 17, 2006
Posts: 9
In better words,how do i access the value of a hyperlink (<ahref> tag) in a servlet?
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12761
    
    5
I not sure what you mean by
access the value of a hyperlink (<ahref> tag)
A servlet or JSP writes an HTML page that has HTML tags (including hyperlinks) in it. A hyperlink URL can contain request parameters that appear in a GET request just like form parameters would appear.
Bill
Manesh Kumar
Ranch Hand

Joined: Mar 21, 2006
Posts: 94
Originally posted by Divya Kamath:
In better words,how do i access the value of a hyperlink (<ahref> tag) in a servlet?


You may try this

This will make multiple requests to process the block sequentially and you can get uniqueId.


Manesh
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: HTML and Servlets
 
Similar Threads
Input type attribute 'name' query?
Hyperlink click error processing
Sending request through links
How can I send data with a hyperlink?
Servlet Request posted thrice