GWT request to download a file

I know that it is not possible to send an ajax request or use the GWT RequestBuidler to send a file download request; I need to have a form for this, but how can I get a link to the answer when it returns, and allows me to say an error.

The request I am sending is intended to download the file, but if the file download is too large, the Java servlet responds with an error, how can I get a link to this error in order to handle it correctly from the GWT side.

+3
source share
2 answers

You can add FormPanel.SubmitCompleteHandler to the form and parse the results in onSubmitComplete ().

+1
source

extGWT HTML, HTML

    com.extjs.gxt.ui.client.widget.Component.addListener(Events.Submit, new Listener<FormEvent>()
    {
        public void handleEvent(final FormEvent event)
        {
            String htmlResponse = event.getResultHtml();

            (...)
        }
    });
+1

Source: https://habr.com/ru/post/1774987/


All Articles