wood burning stoves 2.0*
The moose likes Servlets and the fly likes how to invoke both doGet() and doPost() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to invoke both doGet() and doPost()" Watch "how to invoke both doGet() and doPost()" New topic
Author

how to invoke both doGet() and doPost()

vysh srini
Greenhorn

Joined: Apr 25, 2009
Posts: 25
Hi,

Can anyone tell me how to invoke both doGet() and doPost() method of the servlet
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60741
    
  65

For a single request? You don't. A request is either a GET or a POST, never both.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

You might inside to the doGet call the doPost.


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
yohan dsa
Greenhorn

Joined: Nov 17, 2005
Posts: 3
for a single request you cant. You may chose to overide doService and give call to both doPost & doGet if thts wht you want..
chaitanya karthikk
Ranch Hand

Joined: Sep 15, 2009
Posts: 800

yohan dsa wrote: You may chose to overide doService


There is no such method doService. It is service(HttpServletRequest,HttpServletResponse)


Love all, trust a few, do wrong to none.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to invoke both doGet() and doPost()
 
Similar Threads
overriding both doget() and dopost()
service() in HttpServlet
doGet() and doPost()
Will the browser Session created in the doPost methods be recognised by the doGet
Using get() and post() together