give the syntax of doGet() and doPost()?
Answers were Sorted based on User's Feedback
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 ? | 19 Yes | 4 No |
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 ? | 13 Yes | 1 No |
How to set a cookie that is persisted only for the duration fo the clients session?
Can we define constructor in Servlet class?
how to use servlets with j2ee ?
when the several requests comes to server..how it manage the requests
Explain servlet events?
How is an application exception handling is done using a servlet?
What is the capacity that doGet method can send to the server?
How to handle the debug errors in servlets?
when the jsp page is translated to servlet?
How do you define a servlet?
What are the difference between HttpServlet and GenericServlets?
What are the types of Session Tracking ?