Sam:
Basically, I use the doGet to present info TO the user, and the doPost to
get info FROM the user.
My servlets tend to be of the form: 1> Present the user with a form,
2> User keys in some stuff
3> User presses a button to submit the form
4> The same servlet processes the form, does something, and presents the
user with a confirmation page
This all happens with the same servlet, with 1> being the doGet method, then
2> using doPost (as the form
submits with the POST method in the action tag), and the final output coming
also from doPost.
Mike
Javacorporate Ltd
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's
> Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Sam
> Rose
> Sent: Tuesday, August 24, 1999 8:27 AM
> To: [EMAIL PROTECTED]
> Subject: doPost() or doGet() ???
>
>
> Hello,
>
> I was just wondering, which is better to use.
> I am posting and retrieving data to and from a database.
>
> Should I use doGet() or doPost()?
>
> Or do I do what I have been doing and do this?
>
> public synchronized void doanything (HttpServletRequest req,
> HttpServletResponse res) throws ServletException, IOException {
> }
>
> public synchronized void doGet (HttpServletRequest req,
> HttpServletResponse
> res) throws ServletException, IOException {
> doanything(req, res);}
>
> public synchronized void doPost (HttpServletRequest req,
> HttpServletResponse res) throws ServletException, IOException {
> doanything(req, res);}
>
>
> Cheers for your help
>
> ______________________________________________________________
> _____________
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources:
> http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html