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 |
Does servlet have main method?
What is the capacity the doget can send to the server?
What is new in ServletRequest interface ? (Servlet 2.4)
What do you mean by httpservlet?
why we should override only no-agrs init() method.
How we can create war file in servlet?
Why do we need a constructor in a servlet if we use the init method?
What are different ways for servlet authentication?
Explain life cycle of a Servlet?
What’s the use of the servlet wrapper classes??
What are the mechanisms used by a servlet container for maintaining session information?
What is called servlet mapping?