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

What is a servlet-to-servlet communcation?

1262


What are its drawbacks of cgi?

1196


Can a jsp be called using a servlet?

1209


How the JSP file will be executed on the Server side?

1202


What exactly are the functions of servlet?

1169


When is the servlet instance created in the life cycle of servlet? What is the importance of configuring a servlet?

1108


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

1232


Can you create a deadlock condition on a servlet?

1130


What is the process to implement doget and dopost methods?

1039


What is the use of send redirect () method?

1152


What do you mean by deployment descriptor?

1137


Can we override servlet service method?

1154


How to get the IP address of client in servlet?

1137


What are all the ways for session tracking?

1233


What is the use of java servlet api?

1091