Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


give the syntax of doGet() and doPost()?

Answers were Sorted based on User's Feedback



give the syntax of doGet() and doPost()?..

Answer / 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

give the syntax of doGet() and doPost()?..

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

Post New Answer

More Servlets Interview Questions

Tell us something about servletconfig interface.

0 Answers  


What is java servlet?

0 Answers  


Explain Action Servlet?

0 Answers   Cap Gemini,


Explain in brief the directory structure of a web application?

0 Answers  


can we override service method in my servlet class..?? if yes or no why ??

7 Answers   IBM,


Why servlet is faster than jsp?

0 Answers  


Which java application server is the best?

0 Answers  


What is cookies in servlet with example?

0 Answers  


When a servlet accepts a call from a client, it receives two objects. What are they?

0 Answers  


What is the difference between forward () and sendredirect () functions in servlet? Explain

0 Answers  


Can I override destroy() method of Servlets?

4 Answers   Accenture,


How to get the current httpsession object?

0 Answers  


Categories