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()?

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


Please Help Members By Posting Answers For Below Questions

Is it good idea to create servlet constructor?

1206


What are the types of servlet?

1217


What is dispatcher servlet?

1009


What are the uses of servlets?

1073


How can the referrer and the target urls be used in servlet?

948


What exactly is a servlet?

944


Can servlet have a constructor ?

999


How can you start a jta transaction from a servlet deployed on jboss?

1103


How can you create a session in servlet?

1086


Why do we need servlet filter?

1005


What is SingleThreadModel interface?

1090


What is servlet in web technology?

987


When should you prefer to use doget() over dopost()?

1085


What do you mean by request dispatcher in servlet? Also explain its methods.

1092


What is the web server used for running the Servlets?

962