我在Tomcat 7.0.25上有一个JSF2.0/primefaces网站应用程序。应用程序有一个简单的文件上传表格,如在主页showcase 。
<h:form enctype="multipart/form-data">
<p:messages showDetail="true" />
<p:fileUpload value="#{fileUploadController.file}" mode="simple" />
<p:commandButton value="Submit" ajax="false" actionListener="#{fileUploadController.upload}" />
</h:form>
public void upload() throws IOException {
FacesMessage msg = new FacesMessage("Succesful", this.file.getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, msg);
// do stuff with xml
}
I m trying to make a multipart/form-data POST request to te upload form using a stndalone java client. Sinc now I ve tried this and this but without success.
在这两种情况下,我都会收到 HTTP/1.1 200 OK
回复,我也会收到表格页面,好像POST没有发送一样。
有什么想法吗?