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 difference between PrintWriter and ServletOutputStream?
What is the directory structure of web application?
Whether thread can be used in servlets?
What are the parameters of the service method ?
Explain load on start-up and its importance?
When servlet object is created?
can anybody send me j2ee softwares such as tomcat,weblogic server ,netbeans
Explain the differences between jsp and servlet.
List some life cycle methods of a servlet.
What is the workflow of a servlet?
Which http method is said to be non-idempotent and idempotent?
Write the code to get the server information in servlet.