• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hyperlink

 
Fisher Daniel
Ranch Hand
Posts: 582
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
If we have a hyperlink :
<a href="/myservlet" method="POST">Test</a>
In servlet class, it is handled by doGet() method.
What should we do if we want to sent that request that is handled by doPost() method()?
thanks
daniel
 
Paul Anilprem
Enthuware Software Support
Ranch Hand
Posts: 3893
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hyperlinks always cause a GET request. For post, you have to use a FORM having method=POST. Of course, you can invoke a javascript that submits a form on click of a hyperlink.
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!