Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


give the syntax of doGet() and doPost()?

Answers were Sorted based on User's Feedback



give the syntax of doGet() and doPost()?..

Answer / malli

This is the example for doPost() and doGet();
In this example u can call the doPost() and doGet()like
follows:

Sample Example::
public class PrintCGI extends HttpServlet {

public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws IOException {
printCGIValues(request, response); //doGet() calling
}

public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException {
printCGIValues(request, response); //doPost() Calling
}

public void printCGIValues(HttpServletRequest request,
HttpServletResponse response) throws IOException {

//required lines of code

}
}

Is This Answer Correct ?    11 Yes 3 No

give the syntax of doGet() and doPost()?..

Answer / rajshri

public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
{
doGet(req,res)
}

public void doPost(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException
{
doPost(req,res)
}

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More Servlets Interview Questions

What is the difference between the http servlet and generic servlet?

0 Answers  


What is servlet instance?

0 Answers  


What are the steps that are involved in using the httpservlet class?

0 Answers  


How to get the actual path of servlet in server?

0 Answers  


What are the differences between servlet context vs servlet config?

0 Answers  






What are the differences between the servletconfig interface and the servletcontext interface?

0 Answers  


What are the classes and interfaces for servlets?

4 Answers  


What are the steps that are required to handle the multi-threading?

0 Answers  


What is a deployment descriptor?

0 Answers  


Whats the advantages using servlets over using CGI?

0 Answers  


What is the difference between Servlets and Applets?

0 Answers  


Difference between web container & web server........... Difference between web server & application server?????????

8 Answers   TCS,






Categories