File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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: 14688

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
I agree. Here's the link:
subject: Sending request through links
It's not a secret anymore!