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

Can I override destroy() method of Servlets?

4 Answers   Accenture,


Explain the war file?

0 Answers  


How does tomcat servlet container work?

0 Answers  


Why is http protocol called as a stateless protocol?

0 Answers  


Can we call destroy() method inside the init() method? What happens when we do so?

9 Answers   Ericsson,


What are the objects involved when a servlet receives a call from client?

0 Answers  


How variables can be accessed across the sessions?

3 Answers  


What are the key methods that are involved in processing of http servlets?

0 Answers  


how to use servlets with j2ee ?

2 Answers   Tech Mahindra,


What is the inter-servlet communication?

0 Answers  


Explain the role of dispatcherservlet and contextloaderlistener.

0 Answers  


How session tracking can be achieved, if your browser doesn't support cookies (or) if cookies are disabled?

2 Answers  


Categories