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 |
What are the advantages of Servlet over CGI?
When to use doget() and when dopost()?
What is a servlet engine?
What is the difference between Servlet Request and Servlet Context when calling a Request Dispatcher?
What type of protocols are used in HttpServlet?
Can you explain in detail 'javax.servlet' package?
How can we implement a jsp page?
What must be implemented by all servlets?
Write a program to show the functionality of doget and dopost method?
What is MIME Type?
What do you mean by interservlet communication?
Explain request dispatcher and its methods.