simple servlet program using doPost

hi,i am beginner to servlet.1) How i run simple servletprogram using doPost..?2) Explain any servlet code (doPost) your own example Thanks & Regards,kumar
[200 byte] By [kumartnja] at [2007-11-26 16:14:18]
# 1

In the code bellow, any time you make a HTTP post request to your servlet the doPost method is called, but if you do the otherwise an HTTP get request the doGet method is called instead. ;)

import java.io.*;

import java.net.*;

import javax.servlet.*;

import javax.servlet.http.*;

public class NewServlet extends HttpServlet

{

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException

{

processRequest(request, response);

}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException

{

processRequest(request, response);

}

public String getServletInfo()

{

return "Short description";

}

}

I Hope this helps, you might try this as well

Try this one

http://www.apl.jhu.edu/~hall/java/Servlet-Tutorial/

MeTitus

Me_Titusa at 2007-7-8 22:37:07 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...