I've been trying to update my applications Primefaces to version 3 but I still can't get the fileUpload to work.
Current versions:
Primefaces 3.0.M1 (but tried all above version 3)
Mojarra 2.0.5
Spring 3.0.5.RELEASE
Spring Web Flow 2.3.0.RELEASE
web.xml (upload filter is the first filter in the list and it's called)
Code: Select all
<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>Spring MVC Dispatcher Servlet</servlet-name>
</filter-mapping>
My upload controller (doesn't fire):
Code: Select all
public class FileUploadController {
private com.opensymphony.xwork2.util.logging.Logger logger = LoggerFactory.getLogger(FileUploadController.class);
public void handleFileUpload(FileUploadEvent event) {
logger.debug("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesMessage msg = new FacesMessage("Succesful", event.getFile().getFileName() + " is uploaded.");
FacesContext.getCurrentInstance().addMessage(null, msg);
}
}
Code: Select all
<bean id="fileUploadController" class="pt.m24.yotta.controllers.FileUploadController" scope="request" />
Code: Select all
<h:form enctype="multipart/form-data" >
<p:growl id="msg" showDetail="true"/>
<p:fileUpload fileUploadListener="#{fileUploadController.handleFileUpload}"
mode="advanced"
update="msg"
auto="true"
sizeLimit="1000000"
allowTypes="png,gif,jpg"/>
</h:form>
I would appreciate some help with what I might be doing wrong, thank you in advance.