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 Servlet basics 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 "Servlet basics" Watch "Servlet basics" New topic

Servlet basics

maruti gangumolu

Joined: Aug 06, 2005
Posts: 1
1.hi firends!
i am new servlets. i had a doubt regarding doPost method in servlets,first if i use doPost method which objec(HttpServletRequest,HttpServletResponse) i must use to store information in database.what is the neccessity of calling doGet method from doPost.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41144
doGet and doPost work the same; the difference is in when they're called. doPost is called with the results of an HTTP POST, doGet is called with the results of an HTTP GET. You decide in the method parameter of your <form> tag which one of these it is. Generally, one of these does not call the other one (unless the difference between GET and POST does not matter to you, in which case you implement one of the two, and call that from the other one).

HttpServletRequest is used to access the parameters and information of the incoming request; HttpServletResponse is used to generate the page that is sent back. You would use neither of these to access a database - you have to code that yourself, just like you would in a desktop application.

Ping & DNS - my free Android networking tools app
It is sorta covered in the JavaRanch Style Guide.
subject: Servlet basics
Similar Threads
please reply urgently!!!
Service method
doPost() while using request dispatcher
problem when using request Dispatcher
Servlet - doGet - doPost - parameter