David Wall wrote:
>
> > When posted in a multipart form, the form fields are no longer directly
> > stored in the request, and thus available with a request.getParameter.
>
> I'm not sure what you are really saying, but if you want to ensure that the
> current JRun session parameter is included in forms, including the
> multiparts for uploading files, you should add something like this as a
> hidden parameter for the FORM:
>
> <input type="hidden" name="<%=ServletUtil.GetSessionParamName()%>"
> value="<%=request.getSession(false).getId()%>">
>
> My method ServletUtil.GetSessionParamName() just returns the literal
> "jrunsessionid" which is used by JRun (this will make it easier should I
> switch servlet engines or if that param name ever changes in the future.

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.

Hans
--
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