我正在尝试使用 fileUpload 组件。当我阅读 primefaces 用户指南时,我必须配置 fileUpload 过滤器。
<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
这个过滤器的配置有用吗?如何正确配置它?