Olá pessoal,
eu tenho uma pagina no meu sistema assim…
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<ui:decorate template="/tema/padrao.xhtml">
<ui:define name="centro">
<h:form enctype="multipart/form-data" id="envia">
<p:fileUpload fileUploadListener="#{fileUploadController.upload()}"
allowTypes="/(\.|\/)(mdb|sqlite|)$/" mode="advanced" sizeLimit="9999999" auto="true"/>
<p:growl id="messages" showDetail="true"/>
</h:form>
</ui:define>
</ui:decorate>
</html>
Quando eu adiciono essa configuração no web.xml da erro e eu não consigo executar a aplicação, mas quando tiro eu executo a aplicação normalmente mais não faz o upload…
<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>D:/temp</param-value>
</init-param>
<init-param>
<param-name>thresholdSize</param-name>
<param-value>10000</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
Eu já tenho um filter no meu web.xml… ele sem o código ai em cima ele funciona, mas porque com esse código ele não funciona ?
Meu web.xml está assim… essa configuração acima.
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0" 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">
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<session-config>
<session-timeout>
30
</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>faces/index.xhtml</welcome-file>
</welcome-file-list>
<filter>
<filter-name>conexaoFiter</filter-name>
<filter-class>util.ConexaoHibernateFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>conexaoFiter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bluesky</param-value>
</context-param>
</web-app>