You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a BaseUploadStatus that overrides the default (Window.alert()) behavior.
public class CustomUploadStatus extends BaseUploadStatus {
public interface FileTooLargeHandler {
void onFileTooLarge();
}
private final FileTooLargeHandler fileTooLargeHandler;
public CustomUploadStatus(
FileTooLargeHandler fileTooLargeHandler) {
this.fileTooLargeHandler = fileTooLargeHandler;
}
@Override
public void setError(String msg) {
setStatus(Status.ERROR);
if (msg.startsWith("The request was rejected because its size:")) {
fileTooLargeHandler.onFileTooLarge();
}
}
}
I would like to avoid the msg.startsWith("The request was rejected because its size:"). Depending on that particular string couples me too much with the contents of UploadServlet.properties.
size_limit=The request was rejected because its size: {0} KB, exceeds the maximum: {1} KB
It seems that the UploadServlet.properties file is only available on the server. It would be nice if those messages could be available to a GWT app (maybe leveraging GWT's Messages)
Or, maybe I could use a specific Status for when the uploaded file is too large?
The text was updated successfully, but these errors were encountered:
I created a
BaseUploadStatus
that overrides the default (Window.alert()
) behavior.I would like to avoid the
msg.startsWith("The request was rejected because its size:")
. Depending on that particular string couples me too much with the contents ofUploadServlet.properties
.It seems that the
UploadServlet.properties
file is only available on the server. It would be nice if those messages could be available to a GWT app (maybe leveraging GWT's Messages)Or, maybe I could use a specific
Status
for when the uploaded file is too large?The text was updated successfully, but these errors were encountered: