Hi Albert,

The way I did this is by reading SubmitCompleteEvent.getResults(), i.e.

uploadForm.addSubmitCompleteHandler(new SubmitCompleteHandler() {
            public void onSubmitComplete(SubmitCompleteEvent event) {
 if (event.getResults().contains("SizeException")
         Window.alert("Data entry over limit");
}
}

You would just have to make sure that the servlet which handles the upload 
generates some meaningful, machine readable output which you can parse on 
the client


On Monday, March 12, 2012 12:19:29 PM UTC+2, Appien wrote:
>
> Hi guys,
>
> In my GWT application the user can download a PDF file by using a servlet. 
> To start the download I create in GWT a hidden Frame Object which calls the 
> servlet. The happy workflow path works great however I want give the user 
> some feedback when generating the PDF file fails. Since the result of the 
> servlet call gets ‘printed’ in the Frame object, the printed exception also 
> appears in the hidden Frame and not e.g. by a popup for the user.
>
> Unfortunately I don’t see a way so the servlet throws directly exceptions 
> to the AsyncCallback of GWT.
>
> I’ve the following pseudo code for handling my exception. 
>
> My questions are the following: 
> - Is this the right way to do exception handling for servlet exceptions 
> in GWT?
> - If not, which approach should I use for this?
>
> Many thanks for all the help!
>
> Albert
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/zxkJWOtg4hMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to