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 is the difference between a generic servlet and http servlet?
what is OOAS
what is the difference between do get/dopost
What are cookies and how will you use them?
If servlet receives multiple requests, how many objects will it create?
What is ServletContext() and what is its use?
9 Answers Prime Technology, TCS,
where the session data will stored?
What is servlet and list its types?
If we disable cookies in our web page, what will happen?
What is servlet interface?
Is it possible to send a mail from a servlet? Explain?
How multiple simultaneous requests can be handled by servlets?