Friday, October 29, 2010

Re: gwt FormPanel & servlet integration

On 29 oct, 08:24, hbaydarov <> wrote:
> I'm just writing a simple FormPanel and a servlet that handle it.
> However, there is a problem while getting parameter from FormPanel.
> What I want to say :
>     formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
>     formPanel.setMethod(FormPanel.METHOD_POST);


> protected void doPost(HttpServletRequest req, HttpServletResponse
> resp)
>         throws ServletException, IOException {
>     System.out.println(req.getParameter("name")); // null! why?

getParameter only works when data is sent in application/x-www-form-
urlencoded (as multipart/form-data might be very big and contain
attached files, it would cost too much to parse it ahead from a
getParameter(), and getParameter won't give you the uploaded files).
You have to use something like Apache Commons FileUpload to read/
decode a multipart/form-data payload:

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment