David Wall wrote:
>
> > I don't know about JRun specifically, but a portable solution should be
> > to make sure the URL used in the form's action attribute is "URL
> rewritten",
> >
> >   <form action=<%= response.encodeURL("/servlet/foo") %> method="post">
> >
> > The solution you suggest only works with JRun, since ServletUtil is not
> > a standard class, and URL rewriting (according to the 2.2 spec) should
> > not use an HTTP parameter for the session ID, it should use a syntax like
> >
> >   /servlet/foo;jsessionid=1234?foo=bar
> >
> > Note that it's encoded as what is called a "path parameter", not a regular
> > HTTP parameter. So even if your suggestion works in the current version of
> > JRun, it will likely stop working when JRun is upgraded to support the 2.2
> > spec.
>
> Is this correct?  It seems that JRun won't correctly parse out that session
> id as form parameters for a POST since form parameters don't come in this
> way.  The suggestion of using encodeUrl() inside the action seems nice, but
> it also does not seem to work with JRun.  That is, it doesn't see that
> parameter  unless you use a  hidden form parameter to get it to the servlet
> engine.

In that case it's a bug in JRun. Even if they today (in their 2.1 compliant
servlet container) use a regular HTTP parameter to send the session ID,
encodeURL() should encode the URL according to their conventions, i.e.
something like

  /servlet/foo?jrunsessionid=1234

And they should be able to handle a POST with both a query string and parameters
passed in the POST body. Merging query string and body params has been in the
Servlet spec since 2.1 I believe. If they handle this right, the original problem
(with POST parameters not being available with request.getParameter()) when doing
a file upload would be solved as well, since the query string parameter is available
even with a multipart request.

Hans
PS.It's probably better to bring this discussion to a JRun forum, since it
seems like it's a product specific problem.
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to