Server side does not throw any exception. Regarding the firebug, I don't know how to look for what the browser sends... how can I do this?
On 4 dic, 10:41, Martin Trummer <martin.trum...@24act.at> wrote: > so does your applet actually get called > i mean: when you upload a file in FF, is the doPost > method called? > > maybe you should throw in some log statements and > maybe try to catch all Exceptions in the do post > just to log it > > you could also use firebug to check what the client > actually sends to the server > > On 3 Dez., 20:21, Lena <lena.he...@gmail.com> wrote: > > > I'm writing a gwt site with a form using components from both gwt and > > gwt-ext. Since I need to send a file I can't use gwt's RPC services > > (GWTServletService), so I use a java servlet. I tried it in hosted > > mode and with IE6 and I recieve data properly. However, using firefox > > the servlet does not recieve anything. > > > This is the gwt code corresponding to the form: > > > final FormPanel uploadForm = new FormPanel(); > > uploadForm.setAction(GWT.getModuleBaseURL() + > > "UploadFileServlet1"); > > uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART); > > uploadForm.setMethod(FormPanel.METHOD_POST); > > uploadForm.addFormHandler(new FormHandler(){ > > public void onSubmit(FormSubmitEvent event){ > > > } > > > public void onSubmitComplete(FormSubmitCompleteEvent event){ > > //getExistBD(); > > //wait.hide(); > > //MessageBox.alert(event.getResults()); > > } > > }); > > > // Create a FormPanel and point it at a service. > > final com.gwtext.client.widgets.form.FormPanel inUploadForm = > > new > > com.gwtext.client.widgets.form.FormPanel(); > > inUploadForm.setPaddings(10); > > inUploadForm.setLabelWidth(150); > > > FileUpload file = new FileUpload(); > > file.setName("file"); > > file.addStyleName("margin"); > > > FieldSet fsBD = new FieldSet("Guardar en"); > > fsBD.addStyleName("fieldSet"); > > > final Store statesStore = new SimpleStore(new String[]{"en", > > "es"}, getStates()); > > statesStore.load(); > > > ComboBox cbSaveMode = new ComboBox("Tipo de base de datos", > > "saveMode", 200); > > cbSaveMode.setEmptyText("Seleccionar..."); > > cbSaveMode.setStore(statesStore); > > cbSaveMode.setDisplayField("es"); > > cbSaveMode.setValueField("en"); > > cbSaveMode.setReadOnly(true); > > cbSaveMode.setForceSelection(true); > > cbSaveMode.setMode(ComboBox.LOCAL); > > cbSaveMode.setTriggerAction(ComboBox.ALL); > > cbSaveMode.setBlankText("Este campo es obligatorio"); > > cbSaveMode.addListener(new ComboBoxListenerAdapter(){ > > public void onSelect(ComboBox comboBox, Record record, int > > index) > > { > > cbBD.setValue(""); > > existBDStore.filter("en", comboBox.getValue()); > > > //if(comboBox.getValue().equals("public")){ > > // cbBD.setStore(existPublicBDStore); > > //}else if(comboBox.getValue().equals("private")){ > > // cbBD.setStore(existPrivateBDStore); > > //} > > } > > }); > > > cbBD = new ComboBox("", "nameExistBD", 200); > > cbBD.setEmptyText("Seleccionar..."); > > cbBD.setDisplayField("name"); > > cbBD.setValueField("id"); > > cbBD.setLinked(true); > > cbBD.setMode(ComboBox.LOCAL); > > cbBD.setTriggerAction(ComboBox.ALL); > > cbBD.setReadOnly(true); > > cbBD.setForceSelection(true); > > > final TextField nameField = new TextField("", "nameNewBD", 200); > > nameField.disable(); > > > final Radio rExist = new Radio("Base de datos existente", "bd"); > > rExist.setChecked(true); > > rExist.setHideLabel(true); > > > final Radio rNew = new Radio("Nueva base de datos", "bd"); > > rNew.setChecked(false); > > rNew.setHideLabel(true); > > > rExist.addListener(new CheckboxListenerAdapter(){ > > public void onCheck(Checkbox field, boolean checked){ > > if(checked == true){ > > cbBD.enable(); > > nameField.disable(); > > } > > } > > }); > > > rNew.addListener(new CheckboxListenerAdapter(){ > > public void onCheck(Checkbox field, boolean checked){ > > if(checked == true){ > > cbBD.disable(); > > nameField.enable(); > > } > > } > > }); > > > fsBD.add(cbSaveMode); > > fsBD.add(rExist); > > fsBD.add(cbBD); > > fsBD.add(rNew); > > fsBD.add(nameField); > > > Button uploadSubmitButton = new Button("Submit", new > > ButtonListenerAdapter(){ > > public void onClick(Button button, EventObject e) { > > uploadForm.submit(); > > } > > }); > > > inUploadForm.add(file); > > inUploadForm.add(fsBD); > > inUploadForm.add(uploadSubmitButton); > > > uploadForm.add(inUploadForm); > > > return uploadForm; > > > And here's the java servlet code: > > > protected void doPost(HttpServletRequest request, > > HttpServletResponse response) throws ServletException, IOException { > > > FileItemFactory factory = new DiskFileItemFactory(); > > ServletFileUpload upload = new ServletFileUpload(factory); > > > try { > > List items = upload.parseRequest(request); > > Iterator it = items.iterator(); > > > while (it.hasNext()) { > > FileItem item = (FileItem) it.next(); > > if (!item.isFormField() && > > "file".equals(item.getFieldName())){ > > file = item.getInputStream(); > > }else if("saveMode".equals(item.getFieldName())){ > > saveMode = > > Streams.asString(item.getInputStream()); > > }else if("nameExistBD".equals(item.getFieldName())){ > > existBD = > > Streams.asString(item.getInputStream()); > > }else if("nameNewBD".equals(item.getFieldName())){ > > nameBD = > > Streams.asString(item.getInputStream()); > > } > > } > > }catch(FileUploadException e){ > > e.printStackTrace(); > > }catch(IOException ioe){ > > ioe.printStackTrace(); > > } > > } > > > I've been trying to find out what happens for days and I don't > > understand what happens. If someone can help me I will ve very > > grateful. > > > Thanks in advance > > -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.