Reputation: 15703
I'm trying to setup the gwtupload widget with uiBinder and I'm having a hard time getting this configured.
I got the code working with the regular gwt-fileUpload
widget, but I wanted the gwtupload
because of it's richer functionality. Here is what I did for the gwt-fileUpload
widget:
@UiHandler("calculateComplexityButton")
void onClickCalculateComplexity(ClickEvent e){
formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
formPanel.setMethod(FormPanel.METHOD_POST);
formPanel.setAction(UPLOAD_ACTION_URL);
String fileName = fileUpload.getFilename();
fileUpload.setName(fileName);
formPanel.submit();
}
I'm not seeing how to setup the same thing with gwtupload
. I'm seeing this error:
HTTP ERROR: 404 NOT_FOUND
RequestURI=/servlet.gupld
I don't understand how to map the gwtupload
widget to my servletPath, because I'm configuring it under uiBinder?
Upvotes: 0
Views: 1627
Reputation: 15703
In order to set the servletPath, you must first
Define the servletPath in the widget definition itself.
<up:MultiUploader type="LABEL" ui:field="uploader"
servletPath="/... /SampleUploadServlet"
styleName="{style.myup}" maximumFiles="2"
avoidRepeatFiles="true" validExtensions="xml"/>
Upvotes: 1