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 |
Describe in brief RequestDespatcher?
What is life cycle of Servlet?
What's the servlet interface?
Can we get PrintWriter and ServletOutputStream both in a servlet?
What do you mean by scope object and what are its types?
What is the difference between servlet and jsp?
how the server will know its the same jsp page?
Is servlet synchronized?
What is session variable in servlets?
What do you mean by request dispatcher in servlet?
What is the advantage of Servlets when compared with other server side technologies?
What is the difference between Difference between doGet() and doPost()?