GWT 2.5.0 DevMode
我在下面的file upload
进行了简单的测试,
startupUrl:http://127.0.0.1:8888/UploadTest.html?gwt.codesvr=127.0.0.1:9997
<g:FormPanel ui:field="fpUpload">
<g:VerticalPanel>
<g:FileUpload name="fileData" ui:field="fuUpload" />
<g:Button ui:field="btUpload">Upload</g:Button>
</g:VerticalPanel>
</g:FormPanel>
@UiHandler("btUpload")
public void onClickUploadButton(ClickEvent e) {
System.out.println("fileName:" + fuUpload.getFilename());
fpUpload.setEncoding(FormPanel.ENCODING_MULTIPART);
fpUpload.setMethod(FormPanel.METHOD_POST);
fpUpload.setAction("/files");
fpUpload.submit();
System.out.println("Submitted, please wait!");
}
@UiHandler("fpUpload")
public void onSubmitComplete(SubmitCompleteEvent event) {
System.out.println("Submit completed!");
}
输出:
fileName:C:\fakepath\one_file_chosen_to_upload
Submitted, please wait!
但是,服务器没有收到submit request
,所以“提交已完成!”从未出现过。
与此同时,流量被窥探,submit request
根本没有发送。
$ tcpdump -A -i lo port 8888
也没有抛出异常。有什么想法吗?
@EDIT
问题可在ProdMode
上重现。
@EDIT 2
仅仅重新启动机器后,现在问题似乎就像http submit request
被忽略而无线发出一样无声。不幸的是,我没有线索原因。