Hi!
What must I change, if I want to use doPost instead of doGet? I'm using
tomcat and my little test-programm looks like this:
import javax.servlet.http.*;
import javax.servlet.*;
import java.io.*;
public class HitServlet extends HttpServlet
{
private int mCount;
public void doGet(HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException
{
String message = "Hits: " + ++mCount;
// response.setContentType("text/plain");
// response.setContentLength(message.length());
// PrintWriter out = response.getWriter();
// out.println(message);
}
}
But the programm only runs with the doGet method, with the doPost method the browser shows this error message:
HTTP method GET is not supported by this URL
Why? Thanks.
Bye,
Nick