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 |
Tell us something about servletconfig interface.
What is java servlet?
Explain Action Servlet?
Explain in brief the directory structure of a web application?
can we override service method in my servlet class..?? if yes or no why ??
Why servlet is faster than jsp?
Which java application server is the best?
What is cookies in servlet with example?
When a servlet accepts a call from a client, it receives two objects. What are they?
What is the difference between forward () and sendredirect () functions in servlet? Explain
Can I override destroy() method of Servlets?
How to get the current httpsession object?