hello ,
When i choice a file to upload, and i go to the log of gae to watch
the number of uploaded files , it write "taille : 0" and not "taille :
1" , "taille : 2" ,or ... .

TopPanel.ui.xml :
<g:AbsolutePanel ui:field="absolutePanel">
                <g:Label text="Choix de la personne :"
ui:field="labPersonOrProjectChoice" />
                <g:ListBox ui:field="personOrProjectChoiceList" />
                <g:Label text="Affecter un projet :"
ui:field="labProjectOrPersonAffectChoice" />
                <g:ListBox ui:field="projectOrPersonAffectChoiceList" />
                <g:FormPanel ui:field="formPanel">
                <g:FileUpload ui:field="singleUploader"/>
                </g:FormPanel>
                <g:Button text="SUBMIT" ui:field="button"/>
                <!--  <gwtUpload:SingleUploader ui:field="singleUploader"
fileInputSize="25" /> -->
</g:AbsolutePanel>

TopPanel.java :
[...]
formPanel.setAction(GWT.getModuleBaseURL() + "SampleUploadServlet");
formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
formPanel.setMethod(FormPanel.METHOD_POST);

button.addClickHandler(new ClickHandler(){

                        @Override
                        public void onClick(ClickEvent event) {
                                formPanel.submit();
                        }});

SampleUploadServlet.java :
public void doPost(HttpServletRequest request,HttpServletResponse
response){
        FileItemFactory factory = new DiskFileItemFactory();
        ServletFileUpload upload = new ServletFileUpload(factory);
        List<FileItem> fileItems = new ArrayList<FileItem>();

        try {
                fileItems = upload.parseRequest(request);
                throw new
IllegalArgumentException(""+fileItems.size());

                } catch (FileUploadException e) {
                        e.printStackTrace();
                }
                catch(IllegalArgumentException iae){
                        throw new IllegalArgumentException("taille : 
"+fileItems.size());
                }
        }

        public void doGet(HttpServletRequest request,HttpServletResponse
response){
                try {
                        super.doGet(request, response);
                } catch (ServletException e) {
                } catch (IOException e) {
                }
        }

Thanks for your request

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to