servlets/calling post method
Hello
Is there any way by which you can call the Post method of a servlet from
an anchor.By default it always calls the Get method and the code
<a href = "http://32.72.105.2:8080/servlet/servletName" methods = "Post">
tries to call the get method of the servlet
Arnab
Re: servlets/calling post method
Hi,
I'm not sure that <a href="..."> tag accpets POST or GET methods.The 'methods' attribute of this tag is used for browser-dependent presentation methods not the POST or GET methods. The method="POST" is used in the <FORM> tag. Also HTTP protocol is case-sensitive to its methods name, so you should use POST or GET instead of "Post" or "Get".
Hope to this help.
@lireza
@lireza
Re: servlets/calling post method
Hi
you could always transfer it to the post in your get function
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
{
doPost(req, res);
}
i hope this will help
regards
Palli