Oliver Pistor wrote:
> Hi ! I'm doing the following: Using a html form with
> action='servlet?par1=value1 At the same time the form does a "post",
> of ocurse, with the form variables. Now, can this lead to some strange
> behaviour, i mean, is it ok to mixa GET and a POST in a single
> request? Does anyone has experience with this ? Thanx Oliver
What you are actually mixing here is parameters on the request URI and
in the message body. This will still be processed as a single POST
request.
Yes, it is legal to do this, in a servlet conforming to the 2.1 or 2.2
API specs. It is even legal to use the same parameter name in both
places (because HTTP supports multiple values per parameter name). What
you will see in the duplicate names case depends on how you access the
parameters:
* If you use request.getParameter(name), you will see
the first value for that name from the request URI.
Essentially, this "overrides" any value for the same
parameter name included in the content body from
an input field.
* If you use request.getParameterValues(name), you will
get a merged array of all the parameter values from both
places -- the ones from the request URI will be first,
followed by the ones from the content body.
NOTE: This behavior was not clarified until the JSP 1.0 spec came out,
so older servlet engines supporting 2.1 may not behave this way.
Behavior for servlet engines based on the 2.0 API varies between
servers, because there was no standard for this behavior.
Craig McClanahan
___________________________________________________________________________
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