2
我正在嘗試使用fileUpload組件。當我從primefaces用戶指南閱讀時,我必須配置fileUpload過濾器。JSF配置文件上傳過濾器
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>
org.primefaces.webapp.filter.FileUploadFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
我在web.xml文件中添加了這些行(指導建議)。
現在,當服務器(Tomcat 7)啓動時,出現異常,服務器無法啓動。我會發布堆棧跟蹤的一部分。
GRAVE: A child container failed during start
java.util.concurrent.ExecutionException: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/webApp]]
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at...
Caused by: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItemFactory
at....
Caused by: java.lang.ClassNotFoundException: org.apache.commons.fileupload.FileItemFactory
此過濾器的配置是否有用?我如何正確配置它?
我錯過了他們兩個。謝謝! –
不客氣! –
值得注意的是,它們都應該高於Primefaces依賴項。 – waste