This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Sending request through links Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Sending request through links" Watch "Sending request through links" New topic

Sending request through links

abhinav singhal

Joined: Jun 19, 2003
Posts: 29
Hi All,

I have one link (hyperlink). I want that link to act as a request to servlet or JSP. So that further processing of the data can be carried on. Please let me know how can i do so.

Right now through submit buttons only I am able to send the request and not through the links.
Is there any way I can send the request as
action="http://localhost:7001/Myservlet" in a hyperlink.

Thanks and Regards,
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Simply set that url as href on the hyperlink's anchor. Clicking the link will then send a request to that url.

A good workman is known by his tools.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Don't forget to implement the doGet method if you're submitting via a link.

[My Blog]
All roads lead to JavaRanch
Vishnu Prakash
Ranch Hand

Joined: Nov 15, 2004
Posts: 1026

Here 'a' and 'b' are the Query String.
[ January 03, 2006: Message edited by: Vishnu Prakash ]

Servlet Spec 2.4/ Jsp Spec 2.0/ JSTL Spec 1.1 - JSTL Tag Documentation
Don't get me started about those stupid light bulbs.
subject: Sending request through links