how to close request input stream
Hello, Calling request.getInputStream().close does not work... ...the browser still sends bytes any ideas? Greetings Thanks Peter _ MSN Groups Chat - Freunde finden - leicht gemacht http://groups.msn.com/people/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close request input stream
I tried a file upload field up to 100MB I tried textfield/textareas up to 600kb ( i must use a slow connection ) it looks like the complete request is send? dont know if tomcat or apache receives those bytes - or in other words - my program leaves its service method... to Tim Funk: What status can I set and respond with my previous form? I guess I've tried that but also I see incoming bytes in my network interface... Greetings and Thanks Peter From: Christopher St. John [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: how to close request input stream Date: Tue, 23 Sep 2003 09:34:58 -0500 Peter H. wrote: Calling request.getInputStream().close does not work... ...the browser still sends bytes how many? it won't be an instant stop because there can be many bytes in flight between the browser and your server (operating systems buffers, proxy servers, etc). if still sends bytes means 100's of kilobytes, then something else is going on, and you'd need to look at each hop your bytes are taking on the way to the server to see where they're ending up... -cks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Schluß mit Spam! http://www.msn.de/antispam Wir helfen Ihnen, unerwünschte E-Mails zu reduzieren. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how to close request input stream
Hello, Thanks for your help. I've tried it but the response (Internal Server Error) is displayed after the whole file is send... trying to flush doesn't help either: response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); response.flushBuffer(); response.getWriter().close(); Greetings and Thanks Peter From: Tim Funk [EMAIL PROTECTED] Reply-To: Tomcat Users List [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: how to close request input stream Date: Tue, 23 Sep 2003 11:02:26 -0400 Try this and see what happens: protected void doPost(HttpServletRequest req, HttpServletResponse resp) { if(req.getContentLength()TOO_MUCH) resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); ... } I am unsure of how much date is read before the servlet is called. (Which is probably the crux of the problem) -Tim Peter H. wrote: I tried a file upload field up to 100MB I tried textfield/textareas up to 600kb ( i must use a slow connection ) it looks like the complete request is send? dont know if tomcat or apache receives those bytes - or in other words - my program leaves its service method... to Tim Funk: What status can I set and respond with my previous form? I guess I've tried that but also I see incoming bytes in my network interface... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Sehen, wer online ist: Mit dem MSN Messenger! http://messenger.msn.de Jetzt kostenlos downloaden und mitmachen! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is there really no answer? How to cancel a large upload request with a servlet?
Hello, I've written a file upload where the user get's informed of the currently transferred bytes (asynchron with meta refresh)... on this info page the user can press cancel - an async request is send to the server to another thread of course. this thread informs the uploading thread that it could cancel the job - but after leaving my methods someone still reads the whole request. who can it be? tomcat, apache - dont know --- PLEASE HELP It seems that the whole request is still processed. closing the inputstream does not help... Greetings and thanks Peter _ E-Mails sind Ihnen nicht schnell genug? http://messenger.msn.de MSN Messenger - Kommunikation in Echtzeit - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
upload and renameto apache-tomcat problem
Hello Tomcat-Community, I try to figure out a strange but reproduceable error: Using Apache and Tomcat under windows and maybe linux. After uploading a file to a temporary dir and renaming (moving) it to a apache accessible folder i have strange problems... If i upload a image with the attached servlet and after it accessing the image with apache i must wait some seconds to get a succesful renameTo. the problem is that if i don't create the temporary image file with java the renameTo always succeeds. but the servlet should have file upload behaviour... maybe its the FileServletWrapper but uploading multiple times without accessing the image with apache there is no problem! ps. The FileServletWrapper is only available as class code... Any Suggestions? Thanks Peter code import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import java.util.*; public final class FileServlet extends HttpServlet { static public final String TARGET = /export/wwwdoc/test.jpg; public void service(HttpServletRequest req, HttpServletResponse resp) throws IOException { FileServletWrapper request = new FileServletWrapper(req, new File(/temp)); File source = null; if(request.getFileParameter(file) != null) { source = request.ucdGetFileParameter(file).getFile(); } PrintWriter writer = resp.getWriter(); writer.write(HTML); writer.write(BODY); writer.write(FORM NAME=\main\ ACTION=\http://127.0.0.1/fileservlet\; METHOD=\post\ ENCTYPE=\multipart/form-data\); writer.write(INPUT TYPE=\file\ NAME=\file\/); writer.write(INPUT TYPE=\submit\ VALUE=\upload\/); writer.write(hr); if(source != null) { File target = new File(TARGET); if(target.exists()) { writer.write(Target file existsbr); if(!target.delete()) { writer.write(Target file delete failed: + target + br); return; } } if(source.renameTo(target)) { writer.write(rename succeededbr); } else { writer.write(rename failedbr); } } writer.write(/FORM); writer.write(/BODY); writer.write(/HTML); } } /code _ Mit dem MSN Messenger eine Reise für 4 Personen nach Barcelona gewinnen jetzt mitmachen! http://www.sweepstakes2003.com/entry.aspx?locationid=15 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Is there a Online Archive for searching tomcat-users Mailinglist?
Thanks Peter _ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
wanted: pure fast apache servlet enginge without jsp etc. + ASCII/ISO Enc. Prob.
Is there a way to configure tomcat 4.1.24 or is there a better alternative... Also required: -low memory usage -Not much overhead -just simple and pure Also I have a file.encoding problem with tomcat 4.1.24 (Encoding should be ISO8859-1 but defaults to ASCII) Is there a switch in the tomcat configs or elsewhere? Greetings and Thanks Peter _ MSN - More Useful Every Day http://www.msn.de - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Debian, Apache 2.0.44, Tomcat 4.1.24, IBM JDK 1.4, JNI inprocess
Hello, Does someone use IBM JDK 1.4 with tomcat 4.1.24 and apache 2.0.44 Can't startup JVM exit -1 message... Compiled jni*.so and maybe its the problem because the ././classic/jvm*.so is used? I thought jdk1.4 stops supporting classic jvm... Greetings and thanks Peter _ Fotos - MSN Fotos das virtuelle Fotoalbum. Allen Freunden zeigen oder einfach online entwickeln lassen: http://photos.msn.de/support/worldwide.aspx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Debian, Apache 2.0.44, Tomcat 4.1.24, IBM JDK 1.4, JNI inprocess
Would be nice hint if sun's jvm runs under debian...heard it doesn't You know about this rumor? Thanks From: Richard Dunn [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Tomcat Users List [EMAIL PROTECTED] Subject: Re: Debian, Apache 2.0.44, Tomcat 4.1.24, IBM JDK 1.4, JNI inprocess Date: Thu, 3 Apr 2003 08:45:37 -0700 On Thursday 03 April 2003 08:08, Peter H. wrote: Hello, Does someone use IBM JDK 1.4 with tomcat 4.1.24 and apache 2.0.44 Can't startup JVM exit -1 message... I tried this setup a couple days ago (on Redhat 8.0) and it worked fine, but I am using the mod_jk.so connector. I have not tried the JNI approach. I did notice my applications ran much slower than under the Sun 1.4.1 (both _01 and _02 versions) so I went back to the Sun jdk (despite reports of StringBuffer related memory leaks). I am now on the Apache 2.0.45 and it is working fine. Compiled jni*.so and maybe its the problem because the ././classic/jvm*.so is used? I thought jdk1.4 stops supporting classic jvm... Greetings and thanks Peter - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ MSN Hotmail - Absolut kostenfrei! Der weltweit größte E-Mail-Anbieter im Netz: http://www.msn.de/hotmail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]