aspose file tools*
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet basics" Watch "Servlet basics" New topic
Author

Servlet basics

maruti gangumolu
Greenhorn

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
Marshal

Joined: Mar 22, 2005
Posts: 39544
    
  27
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 - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet basics
 
Similar Threads
please reply urgently!!!
doPost() while using request dispatcher
Service method
Servlet - doGet - doPost - parameter
problem when using request Dispatcher