Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 59570 invoked by uid 500); 22 Apr 2001 19:46:21 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 59563 invoked from network); 22 Apr 2001 19:46:21 -0000 Received: from dnvrpop3.dnvr.uswest.net (206.196.128.5) by h31.sny.collab.net with SMTP; 22 Apr 2001 19:46:21 -0000 Received: (qmail 22047 invoked by uid 0); 22 Apr 2001 19:46:25 -0000 Received: from cx779279-a.msnv1.occa.home.com (HELO uswest.net) (24.177.200.215) by dnvrpop3.dnvr.uswest.net with SMTP; 22 Apr 2001 19:46:25 -0000 Date: Sun, 22 Apr 2001 12:40:54 -0700 Message-ID: <3AE333C6.618DCCC@uswest.net> From: "Anne Dirkse" To: tomcat-user@jakarta.apache.org X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Subject: Re: file upload servlet References: <20010422194644.B95067@gil.physik.rwth-aachen.de> <3AE31D78.956CDDCC@uswest.net> <20010422203533.A95376@gil.physik.rwth-aachen.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Christoph -- You do need the trailing = after <% Here's why: What you are trying to send from your HTML form is something like this:
The <%= %> is a jsp Expression, which means that the value of whatever is in it will be converted to a String and then printed out. Since this is done before the HTML is processed, what you get is something like in the above example. As you have it below, with <% %>, you are not ever actually including the value of your encoded URL into your form. It's just a scriptlet, which will actually encode your URL, but to no avail, since it has no explicit String conversion or printout capabilities and thus won't be a part of your form. all the <%= response.encodeURL("/path/to/Servlet") %> is doing is rewriting your URL to include session data if cookies are not enabled. For a first shot at it, you might want to consider just building a set of tags like I included above and making sure that works (make sure you have cookies enabled, though!) After you have that working, it might be a lot easier to get your session encoding working, conceptually. What the leftover method="post"> signals to me is that somewhere you are closing the form tag before this part of it, i.e., that the browser encounters a > before it encounters method="post"> and thus assumes that the form tag has been completed and that method="post"> is regular text to be printed to the browser window. Hope that helps, Anne Christoph Kukulies wrote: > > On Sun, Apr 22, 2001 at 11:05:44AM -0700, Anne Dirkse wrote: > > My guess is that you have an extra > somewhere (or that you missed the < > > at action=<%=) > > The trailing = looks like being added by the mailer. > > It seems to me that I'm missing something more essential. I'm running > tomcat 3.2 beta. The (jsp) examples all seem to work. > > Even written like this: > >
response.encodeUrl("/servlets/servlet/Upload") > %> > method="post"> > > >
> > > doesn't change the picture. > > > > > Anne > > > > Christoph Kukulies wrote: > > > > > > On Fri, Apr 20, 2001 at 06:58:26PM +0200, Ralph Einfeldt wrote: > > > > For a pure HTML solution you need two things: > > > > > > > > a form with at least one file input tag: > > > > > > > >
> > > response.encodeUrl("'path-to-your-servlet'") %> method="post"> > > > > > > > >
> > > > > > This is looking very elegant to me. I tried it but I'm getting > > > > > > method="post"> > > > > > > at the beginning of the page when it appears in the browser. > > > > > > Is there a typo (or some mail agent added something, like a '=' sign?) > > > or am I missing something more severe? > > > > > > -- > > > Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de > > -- > Chris Christoph P. U. Kukulies kuku@gil.physik.rwth-aachen.de