Re: Cannot read httpservlet's inputstream

2009-04-09 Thread Andrey Razumovsky
"/*" works! Thanks! 2009/4/9 Mark Thomas > Andrey Razumovsky wrote: > > Finally I did it! What was to be done is to change servlet mapping > > > > / > > to > > /DoveServlet > > Did you try: > /* > ? > > Mark > > > > - > To unsub

Re: Cannot read httpservlet's inputstream

2009-04-09 Thread Mark Thomas
Andrey Razumovsky wrote: > Finally I did it! What was to be done is to change servlet mapping > > / > to > /DoveServlet Did you try: /* ? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional comma

Re: Cannot read httpservlet's inputstream

2009-04-09 Thread Andrey Razumovsky
Finally I did it! What was to be done is to change servlet mapping / to /DoveServlet so somewhy POST to servlet mapped to all urls does not work. Now I need URL like /Dove/DoveServlet instead-of /Dove, but I'll survive this :) 2009/4/9 Andrey Razumovsky > Same evil happens when I try to send M

Re: Cannot read httpservlet's inputstream

2009-04-09 Thread Andrey Razumovsky
Same evil happens when I try to send Multipart request: HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(address); MultipartEntity entity = new MultipartEntity(); entity.addPart("file", new FileBody(pack)); post.setEntity(entity);

Re: Cannot read httpservlet's inputstream

2009-04-09 Thread Andrey Razumovsky
Hi friends, Problem still exists... Unforntunately I do not have a public URL. Could you share you HTTP POST request code. Lines with Content-Type, Content-Length etc are commented out because I tried them but they didn't help. Event if I set them, server receives GET with content-length=-1. Chang

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread André Warnier
André Warnier wrote: Trying to redeem myself to Andrey for hijacking his post.. Andrey, in your (latest) client code you do not set either a content-length, nor a "chunked" encoding headers. Is it possible that Tomcat 6 just ignores your POST content in that case ? In RFC2616, I find this in se

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread André Warnier
Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Cannot read httpservlet's inputstream Does there exist a library somewhere which allows me to feed it this InputStream and which will parse the parts for me appropriately (for example allowing me to dete

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 4/7/2009 5:56 PM, André Warnier wrote: > Now suppose I /do/ a POST with multipart/form-data encoding to a Tomcat > servlet, and one of the parts /is/ a large file. > How can I handle this at the servlet level ? Of course you can. Haven't we

RE: Cannot read httpservlet's inputstream

2009-04-07 Thread Caldarale, Charles R
> From: André Warnier [mailto:a...@ice-sa.com] > Subject: Re: Cannot read httpservlet's inputstream > > Does there exist a library somewhere which allows me to feed it this > InputStream and which will parse the parts for me appropriately (for > example allowing me

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread André Warnier
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 4/7/2009 4:49 PM, André Warnier wrote: Ok Mark, I don't pretend I know how it works in Tomcat. How does one upload a file then ? That depends on how you /want/ to upload it. If you want to use the standard HTM

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 4/7/2009 4:49 PM, André Warnier wrote: > Ok Mark, I don't pretend I know how it works in Tomcat. > How does one upload a file then ? That depends on how you /want/ to upload it. If you want to use the standard HTML form-based file upload, y

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Mark Thomas
André Warnier wrote: > Mark Thomas wrote: >> André Warnier wrote: >>> Despite what you may wish and what you may have found in Google, I >>> believe that if you want to send a file, you have to do it with a >>> "multipart/form-data" content type. >> >> Nope. That is just plain wrong. >> >>> http://

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread André Warnier
Mark Thomas wrote: André Warnier wrote: Despite what you may wish and what you may have found in Google, I believe that if you want to send a file, you have to do it with a "multipart/form-data" content type. Nope. That is just plain wrong. http://www.faqs.org/rfcs/rfc2616.html Sections 9.5

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Mark Thomas
André Warnier wrote: > Despite what you may wish and what you may have found in Google, I > believe that if you want to send a file, you have to do it with a > "multipart/form-data" content type. Nope. That is just plain wrong. > http://www.faqs.org/rfcs/rfc2616.html > Sections 9.5 (POST) and 9.6

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread André Warnier
Andrey Razumovsky wrote: Well, I've been looking through those 15 lines last two days.. I tried Apache's HttpClient with same effect (I used FileEntity for body, not multipart). I've seen many examples in Google which send post request.. My code is just the same.. Hi. I did some research, becaus

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrey, On 4/7/2009 10:12 AM, Andrey Razumovsky wrote: > HttpURLConnection connect = (HttpURLConnection) > url.openConnection(); > connect.setRequestMethod("POST"); > connect.setDoInput(true)

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrey, On 4/6/2009 11:47 AM, Andrey Razumovsky wrote: > //connect.setRequestProperty("Content-Type", "text/plain"); One more thing: you should /definitely/ set the charset in the Content-Type. - -chris -BEGIN PGP SIGNATURE- Version:

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Andrey Razumovsky
request's header and > > content > > > > Andrey > > > > 2009/4/7 Caldarale, Charles R > > > > > >>> From: Andrey Razumovsky [mailto:razumovsky.and...@gmail.com] > >>> Subject: Re: Cannot read httpservlet's inputstream >

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread David Smith
om simple HTML,everything's fine. > > Hope you'll help me to figure out who's replacing request's header and > content > > Andrey > > 2009/4/7 Caldarale, Charles R > > >>> From: Andrey Razumovsky [mailto:razumovsky.and...@gmail.com] >&g

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Andrey Razumovsky
getResponseCode()); } else { System.out.println("file " + pack.getPath() + " transfered"); } } 2009/4/7 Caldarale, Charles R > > From: Andrey Razumovsky [mailto:razumovsky.and...@gmail.com] > > Subject: Re: Cannot read httpserv

RE: Cannot read httpservlet's inputstream

2009-04-07 Thread Caldarale, Charles R
> From: Andrey Razumovsky [mailto:razumovsky.and...@gmail.com] > Subject: Re: Cannot read httpservlet's inputstream > > I'm sending POST request from Java (see code in my first message) > to Tomcat 6. But, somehow, the request comes there is GET (!) Also > Content-Le

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Andrey Razumovsky
ovsky [mailto:razumovsky.and...@gmail.com] > > Subject: Re: Cannot read httpservlet's inputstream > > > > I figured out that the problem is in client side... > > When I fire POST request from HTML, it is received well... > > I've doublechecked my connection code - it s

RE: Cannot read httpservlet's inputstream

2009-04-07 Thread Caldarale, Charles R
> From: Andrey Razumovsky [mailto:razumovsky.and...@gmail.com] > Subject: Re: Cannot read httpservlet's inputstream > > I figured out that the problem is in client side... > When I fire POST request from HTML, it is received well... > I've doublechecked my connecti

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Andrey Razumovsky
I figured out that the problem is in client side... When I fire POST request from HTML, it is received well... I've doublechecked my connection code - it seems all right. Can anyone help me here?

Re: Cannot read httpservlet's inputstream

2009-04-07 Thread Andrey Razumovsky
Hi Chris, I've found that my servlet is receiving request GET instead-of POST. Maybe this is causing the problem.. I used to get 200, but now when I removed doGet(...) I get 405. Maybe I need to tune Tomcat somehow so that it could receive POST? 07.04.2009 12:36:37 RequestDumperValve invoke : REQ

Re: Cannot read httpservlet's inputstream

2009-04-06 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Andrey, On 4/6/2009 11:47 AM, Andrey Razumovsky wrote: > if (connect.getResponseCode() != HttpURLConnection.HTTP_OK) { > logObj.warn("file " + pack.getPath() + " was not transfered - > response code " + > connec