我很想知道,是否有任何人设法取得标语<代码>p:fileupload。 网络应用8服务器的部分工作
我使用了2.2.1总理版本。
<h:form enctype="multipart/form-data">
<p:fileUpload
fileUploadListener="#{mailBean.handleFileUpload}"
multiple="true"
label="choose"
allowTypes="*.jpg;*.png;*.gif;"
description="Images"/>
</h:form>
public void handleFileUpload(FileUploadEvent event)
{
files.add(event.getFile());
logger.info("File uploaded into MailBean: " + event.getFile());
System.out.println("File uploaded into MailBean: " + event.getFile());
}
<>Web.xmlfil: (Servlet 3.0)
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>thresholdSize</param-name>
<param-value>51200</param-value>
</init-param>
<init-param>
<param-name>uploadDirectory</param-name>
<param-value>c:/temp/pf</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
这一部分说,吉大港山区的错误,变成了红色,在小岛上,我得到我的印象:
Caused by: javax.faces.application.ViewExpiredException: /createmail.xhtml
No saved view state could be found for the view identifier: /createmail.xhtml
at org.apache.myfaces.lifecycle.RestoreViewExecutor.execute(RestoreViewExecutor.java:128)
at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
我甚至用另外两种版本的Mojarra而不是Myface进行了审判,但我有错误(2.1:手里的脑膜炎被援引, 2.0.3:见到)。