如何完成从JSF按钮调用但在托管bean中被拦截的提交?
在我的JSF视图中,我指定鼠标指针在提交表单时变为沙漏如何完成从JSF按钮调用但在托管bean中被拦截的提交?,jsf,Jsf,在我的JSF视图中,我指定鼠标指针在提交表单时变为沙漏 <h:form onsubmit="document.body.style.cursor='wait'" enctype="multipart/form-data"> 问题是,在生成和下载文件后,鼠标指针仍处于等待状态。很明显,JSF页面没有得到,提交完成了。任何关于如何解决这个问题的提示都会被告知。这有什么帮助吗?我猜您无法触发提交完成回调: <p:commandButton value="Print"
<h:form onsubmit="document.body.style.cursor='wait'" enctype="multipart/form-data">
问题是,在生成和下载文件后,鼠标指针仍处于等待状态。很明显,JSF页面没有得到,提交完成了。任何关于如何解决这个问题的提示都会被告知。这有什么帮助吗?我猜您无法触发提交完成回调:
<p:commandButton value="Print"
action="#{projectController.doPrint()}"
ajax="false" />
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse)
fc.getExternalContext().getResponse();
OutputStream output = response.getOutputStream();
response.reset();
response.setContentType("application/pdf");
response.setHeader("Content-Disposition", "attachment; filename=\"" + fileName + "\"");
pdfWriter = PdfWriter.getInstance(pdfDoc, output);
pdfWriter.setInitialLeading(12);
pdfDoc.open();
//do pdf stuff
pdfDoc.close();