This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Can we use doGet and doPost methods in a single Servlte? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Can we use doGet and doPost methods in a single Servlte?" Watch "Can we use doGet and doPost methods in a single Servlte?" New topic
Author

Can we use doGet and doPost methods in a single Servlte?

Sanjay Bahrani
Ranch Hand

Joined: Apr 17, 2001
Posts: 38
Hi there,
Can We perform 2 different operations with the database by using doGet and doPost methods.
For eg. one method is used to send the data in database (ie doPost) and other method is to collect the info from database (ie doGet).
Remember both should be from a single Html page.
Thankz.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Yes, you can use bothe methods. You can just have one call the other. i.e. call your doGet method from doPost or vice versa.
Bosun

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
 
subject: Can we use doGet and doPost methods in a single Servlte?
 
Similar Threads
Is a Servlet thread-safe
doPost() & doGet()
Servlet Forward
isUserInRole() doubt
why we should not override service() method in a servlet