>>> Jeff Aldrich <[EMAIL PROTECTED]> 20-Apr-00 7:02:05 PM >>>
>Because our application uses a mixture of GET and POST
>(as do most), sessions are not being handled properly when
>forms are submitted using POST
>It seems my only option is to embed a
>hidden field in all forms and submit it with the form.
No. That's wrong.
You should simply encode the action of the form.
For example, if the form looks like this:
<form method="POST" action="http://myserv/myservlet">
then the servlet, or JSP that outputs the page should be doing this:
out.println("<form method=\"POST\" action=\"");
out.println(response.encodeURL("http://myserv/mysevlet"));
This will produce the following:
<form method="POST" action="http://myserv/myservlet?SESSIONID=XXXX">
When the browser submits the form it will automatically multiplex the
form fields and the query specified in the action field.
At least... that's the theory.
There was a debate here some time ago about the best method for
encoding session, I'm sure that path extensions won and I'm surprised
the JRUN team hasn't moved over yet.
However, that wouldn't make any difference to your problem, you'd
still have to encode the action URL.
Nic Ferrier
___________________________________________________________________________
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