On 11 déc, 12:22, Qi Zhang <[email protected]> wrote: > Hi, > > Actually after I changed > the form.setEncoding(FormPanel.ENCODING_MULTIPART); > to form.setEncoding(FormPanel.ENCODING_URLECONDING), those parameters are > passed to the servelt successfully, I really do not understand why?
Because servlet's getParameter() usually don't decode multipart/form- data (because it might contain files) while they (servlet containers) usually decode application/x-www-form-urlencoded (because they can only contain strings). You'd have to read multipart/form-data "yourself", many people using Apache Commons FileUpload. > I use traditional forms because I already have existing servlet code to > handle the form submission. You could use RequestBuilder on the client side, building your application/x-www-form-urlencoded payload yourself.But for file uploads, you have no other options than forms (or Flash, or Gears, or BrowserPlus, or the upcoming ability to send files via XMLHttpRequest that some browsers already ship; but forms are the easiest way of doing it in a cross-browser way, Flash being the second easiest). -- 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.
