This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTML and Servlets

 
Divya Kamath
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you generate a timestamp and embed it in the url as a querystring variable, you can retrieve it with request.getParameter("timestamp");

 
Divya Kamath
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic