Return-Path: Delivered-To: apmail-beehive-user-archive@www.apache.org Received: (qmail 93936 invoked from network); 23 May 2007 17:23:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 May 2007 17:23:04 -0000 Received: (qmail 33352 invoked by uid 500); 23 May 2007 17:23:08 -0000 Delivered-To: apmail-beehive-user-archive@beehive.apache.org Received: (qmail 33336 invoked by uid 500); 23 May 2007 17:23:08 -0000 Mailing-List: contact user-help@beehive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Beehive Users" Delivered-To: mailing list user@beehive.apache.org Received: (qmail 33325 invoked by uid 99); 23 May 2007 17:23:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 10:23:08 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of noofiz@yandex.ru designates 213.180.223.92 as permitted sender) Received: from [213.180.223.92] (HELO pantene.mail.yandex.net) (213.180.223.92) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 May 2007 10:23:01 -0700 Received: from YAMAIL (pantene.yandex.ru) by mail.yandex.ru id ; Wed, 23 May 2007 21:22:30 +0400 Received: from [87.240.15.29] ([87.240.15.29]) by mail.yandex.ru with HTTP; Wed, 23 May 2007 21:22:18 +0400 (MSD) Date: Wed, 23 May 2007 21:22:18 +0400 (MSD) From: =?KOI8-R?B?Iu3JyMHJzCBOb29maXoi?= Sender: noofiz@yandex.ru Message-Id: <4654784A.000001.17001@pantene.yandex.ru> MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] Errors-To: noofiz@yandex.ru To: user@beehive.apache.org Subject: Re: File uploading X-MsgDayCount: 1 X-BornDate: 1173042000 In-Reply-To: Reply-To: noofiz@yandex.ru References: <46461B42.000006.16054@webmail14.yandex.ru> X-Source-Ip: 87.240.15.29 Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hello. I got all libraries from here(http://jakarta.apache.org/commons/fileupload/dependencies.html): commons-io-1.3.jar commons-fileupload-1.0.jar junit.jar(3.8.2) portlet-api-1.0.jar And simple example: FileItemFactory factory = new DefaultFileItemFactory(); FileUpload upload = new FileUpload(factory); List items = upload.parseRequest(request); Iterator iter = items.iterator(); while (iter.hasNext()) { FileItem item = (FileItem) iter.next(); if (item.isFormField()) { out.println(item.getFieldName()); } else { out.println(item.getFieldName()); } } Nothing happend, while whithout NetUI(request directly to jsp) it works I made similar example whith the latest versions of above libraries, the same result. By the way, while writing my previous letter I used com.oreilly.servlet.multipart instead org.apache.commons.fileupload. The problem was that I didn`t load commons-io library ;). When I loadded it I got: java.io.IOException: Corrupt form data: premature ending (http://unix.org.ua/orelly/java-ent/servlet/ch04_04.htm) Whithout netui everything is stil ok. May be you have a working example of a simple fileuploading servlet? Thanks. Whith best regard? Mikhail. >The exception in #2 looks like a dependency issue. What version of >commons-fileupload do you have? Beehive is built on Struts 1.2.9 which >ships with commons-fileupload v1.0. It looks like the more recent >version of commons-fileupload are now dependent on the commons-io. You >probably need to include this jar with your version of >commons-fileupload. See... > >http://jakarta.apache.org/commons/fileupload/dependencies.html > >for the dependencies. > >Hope that helps, >Carlin > >On 5/16/07, "������ Noofiz" wrote: >> I tried both ways: >> 1)I created beehive-netui-config.xml in WEB-INF, the encoding is realy UTF-8: >> >> >> >> >> memory >> >> >> >> but webapp refused to start: >> >> FAIL - Encountered exception java.lang.IllegalStateException: Container org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/netui-tutorial] has not been started >> >> 2)I removed beehive-netui-config.xml and added to Controller`s annotation: >> >> @Jpf.Controller( >> simpleActions={ >> @Jpf.SimpleAction(name="begin", path="index.jsp") >> }, >> multipartHandler=Jpf.MultipartHandler.memory >> ) >> >> and I got this while uploading file: >> >> exception >> >> javax.servlet.ServletException: Servlet execution threw an exception >> >> root cause >> >> java.lang.NoClassDefFoundError: org/apache/commons/io/output/DeferredFileOutputStream >> org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:103) >> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:350) >> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:302) >> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(CommonsMultipartRequestHandler.java:193) >> org.apache.beehive.netui.pageflow.MultipartRequestUtils.preHandleMultipartRequest(MultipartRequestUtils.java:209) >> org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processMultipart(PageFlowRequestProcessor.java:921) >> org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processActionOverride(PageFlowRequestProcessor.java:359) >> org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.processInternal(PageFlowRequestProcessor.java:469) >> org.apache.beehive.netui.pageflow.PageFlowRequestProcessor.process(PageFlowRequestProcessor.java:853) >> org.apache.beehive.netui.pageflow.AutoRegisterActionServlet.process(AutoRegisterActionServlet.java:631) >> org.apache.beehive.netui.pageflow.PageFlowActionServlet.process(PageFlowActionServlet.java:158) >> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:710) >> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) >> >> >> >By default, multipart request handling is disabled. The "NetUI Form >> >Control Tags" document includes a section on the >> >tag and how to enable multipart request handling. See... >> > >> >http://beehive.apache.org/docs/1.0.2/netui/tags/formControls.html#FileUpload >> > >> >Kind regards, >> >Carlin >> > >> >On 5/12/07, "������ Noofiz" wrote: >> >> Hello. >> >> >> >> I`ve got a problem while uploading files with com.oreilly.servlet.multipart library. >> >> from a jsp page I call a class method? which simply shwos the uploaded file name. >> >> >> >> Wheb I navigate directly to jsp page everything OK: >> >>
>> >> >> >> But when I try to do the same through the action, which just redirects to page1.jsp, I get: >> >> javax.servlet.ServletException: Received a multipart request, but multipart handling is not enabled. >> >> >> >> Thanks >> >> >> >> >> -- >> ������.����� - ������� ����, ������� ������! http://fotki.yandex.ru/ >> -- ������� ����� �������� � �������.��? http://moikrug.ru/