bot_bot bot_bot - 1 year ago 120
reST (reStructuredText) Question

In GWT, is it possible to redirect a file upload to another REST service?

I've been reading this question about

FileUpload
in GWT. I have a GWT web app and a Spring Boot service with a
REST
API. The GWT app needs to allow the user to post a file, along with some
URL
query string parameters to the Spring Boot service.

Is it possible to redirect the upload so the file is sent directly to the Spring Boot service or do I need to upload it to a GWT
Servlet
first, then forward it on to the Spring Boot service?

Answer Source

Yes, I figured it out. In the FormPanel you need to call FormPanel.setAction() and pass it the URL of the service you want to post to. The data will be posted once you call FormPanel.submit().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download