我的页面上有 ap:fileUpload 功能,每次上传文件时,我似乎都无法在 web.xml 文件中指定的文件夹中找到它。
我已将以下 jar 添加到我的库中:primefaces-3.2.jar commons-io-2.3.jar commons-fileupload-1.2.2.jar
这是我的 web.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
<init-param>
<param-name>uploadDirectory</param-name>
<param-value>C:\Users\SomeUser\Documents\NetBeansProjects\System\Upload\</param-value>
</init-param>
<init-param>
<param-name>thresholdSize</param-name>
<param-value>1000000</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<error-page>
<error-code>404</error-code>
<location>/404.jsf</location>
</error-page>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>aristo</param-value>
</context-param>
</web-app>
我正在使用以下产品:PrimeFaces 3.2、JSF 2.0 和 GlassFish 3.1.1
任何帮助将不胜感激。谢谢