File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 60041
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to invoke both doGet() and doPost()
 
Similar Threads
doGet() and doPost()
service() in HttpServlet
Using get() and post() together
Will the browser Session created in the doPost methods be recognised by the doGet
overriding both doget() and dopost()