On Fri, Mar 16, 2012 at 10:27 PM, Ashish <testysi...@gmail.com> wrote:

> I am new to GWT and am trying to implement a file upload
> functionality. Found some implementation help over the internet and
> used that as reference. But have some questions related to that:
>
> The actual upload or writing the contents of file on server(or disk)
> will be done by a servlet. Is it necessary that this servlet (say
> MyFileUploadServlet) extends HttpServlet? OR
> I can use RemoteServiceServlet or any other servlet or implement any
> other interface? If yes, which method do I need to implement/override?
>
> In my servlet, after everything is done, I need to return back the
> response back to the client. I think form.addSubmitCompleteHandler()
> can be used to achieve that. From servlet, I could return text/html
> (or String type object) and then use SubmitCompleteEvent.getResults()
> to get the result.
> Question is that can I use my custom object instead of String (lets
> say MyFileUploadResult), populate the results in it and then pass it
> back to client? or can I get back JSON object?
>
> Currently, after getting back the response and using
> SubmitCompleteEvent.getResults(), I am getting some HTML tags added to
> the actual response such as :
>
> pre> Image upload successfully /pre> .
>
> Is there a way to get rid of that?
>


yes, set response-type to text/html would help



>
> Thanks a lot in advance!
>
> Regards,
>
> Ashish
>
> --
> 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-toolkit@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.
>
>

-- 
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-toolkit@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.

Reply via email to