Results 1 to 1 of 1
- 03-16-2012, 11:37 PM #1Member
- Join Date
- Mar 2012
- Rep Power
GWT FileUpload - Servlet options and handling response
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?
Thanks a lot in advance!
- By giladma in forum Java ServletReplies: 0Last Post: 09-23-2011, 04:27 PM
- By kalyana in forum New To JavaReplies: 1Last Post: 03-27-2011, 04:10 PM
- By gretty in forum Java AppletsReplies: 0Last Post: 02-20-2011, 02:31 AM
- By an24 in forum Java ServletReplies: 2Last Post: 12-21-2009, 07:40 PM