How can I submit an HTTP POST request when the user clicks a normal HREF link?

0
9598

You can post to a servlet using JavaScript through HREF in the following way. Any parameters you need to send can be sent using the “hidden” parameters.

<form name="submitForm" method="POST" action="/servlet/ServletName">
<input type="hidden" name="param1" value="param1Value">
<A HREF="javascript:document.submitForm.submit()">Click Me</A>
</form>