I am trying to call a serlvet from javascript. Code below:
document.location.href="service1servlet";
It perfectly delegates call to the servlet but with an error as:
HTTP Status 405 - HTTP method GET is not supported by this URL
I guess its looking for doGet method in servlet. How do I make it call doPost method in that servlet? Servlet doPost method below:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("THIS IS IN SERVICE!SERVLET AND CAN CHANGE DATABASE");
}