Answer Posted / malli
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 |
Post New Answer View All Answers
How do you communicate in between Applets and Servlets?
Explain load on start-up and its importance?
When jsessionid is created?
What is servlet and its advantages?
How can we invoke another servlet in a different application?
What is api in servlet?
What are the life-cycle methods for a servlet?
How can you use a servlet to generate a plain text instead of html?
What is a servlet?
What do you mean by url pattern in servlet?
How do you invoke a servelt?
What are the types of an http request?
What is java servlet?
What is the difference between Servlets and Applets?
Explain get and post.