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
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Servlet basics
 
It's not a secret anymore!