HTTP GET and POST are fundamentally different. GET is an idempotent request,
i.e. when you as a servlet receive a GET you can ALWAYS safely execute your
code, GETs MUST be coded without side effects to conform to the HTTP
specification.
POSTs on the other hand are defined as non-idempotent, which means that
processing an HTTP POST may have side effects.
For example database INSERTs whould ALWAYs be done using POST (an insert has
the 'side-effect' of changing the database), whereas a database SELECT
should be done via an HTTP GET (no side effect). Browsers attempt to enforce
this by asking the 'do you really want to do this?' question when you hit
refresh to refresh a page that was generated from a POST,
Kevin Jones
DevelopMentor
www.develop.com
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
> Victor Hadianto
> Sent: 29 August 2000 13:29
> To: [EMAIL PROTECTED]
> Subject: Re: repost data in doGet
>
>
> > >
> > >Isn't that interesting? I always thought that the doGet() will
> be called
> > >instead if the user click on the 'refresh' button.
> >
> > No, it just repeats the previous command
>
> I don't now about other people opinion, but I really think it's
> better when
> the browser 'Refresh' button just fetch whatever link in the text bar. I
> could not see any benefit of clicking refresh to post the last
> request. This
> lead to many of the 'interesting features' from a lot of sites where the
> browser ask the unscrupulous question whether you want to repost the data
> (both IE and Netscape) have odd messages.
>
> And then again, people with limited experience like myself tend to expect
> the other applications to behave what I think is right, and not the other
> way around.
>
> > Actually, I meant "the same as the POST page" - a servlet can
> handle both
> GET and POST. That way the user would never > >see the difference.
>
> not necessarly, and adept user will see that in the doGet() method we pass
> the parameter on the link, I mean something like this
> /servlet/my_servlet.html?data1=horriblecode
>
> Actually now that I think about it, I really am not sure how do
> the servlet
> engine handle the parameter in doPost() from the form.
> Transparent as it is
> from the serlvet programmer, it really helps to understand the
> nitty gritty
> of servlet.
>
> vic .
>
> __________________________________________________________________
> _________
> 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
___________________________________________________________________________
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