仅为备用请求触发Primefaces 5 fileupload事件

时间:2014-08-01 07:56:22

标签: jsf-2 primefaces

我正在使用primefaces 5和一个简单的p:fileupload标记仅针对备用请求触发事件。事件在第1个第3个触发,依此类推,而不是在第4个等等。这发生在mode = simple / advanced,auto = true / false,multiple = true / false。 Id multiple = true然后我选择4/5文件只触发2/3文件事件。

这是一个已知问题吗?或者我错过了任何配置?

Primeface 5 Apache tomcat 7 tomcat 7中的罐子

all-themes-1.0.10.jar
annotations-api.jar
antlr-2.7.2.jar
bsf-2.3.0.jar
catalina-ant.jar
catalina-ha.jar
catalina-tribes.jar
catalina.jar
commons-beanutils-1.8.0.jar
commons-chain-1.2.jar
commons-digester-1.8.jar
commons-fileupload-1.2.2.jar
commons-io-2.4.jar
commons-logging-1.0.4.jar
commons-net-3.3.jar
ecj-P20140317-1600.jar
el-api.jar
jasper-el.jar
jasper.jar
jsf-api-2.2.7.jar
jsf-impl-2.2.7.jar
jsp-api.jar
jstl-1.2.jar
oro-2.0.8.jar
primefaces-5.0.jar
servlet-api.jar
standard-1.0.6.jar
tomcat-api.jar
tomcat-coyote.jar
tomcat-dbcp.jar
tomcat-i18n-es.jar
tomcat-i18n-fr.jar
tomcat-i18n-ja.jar
tomcat-jdbc.jar
tomcat-util.jar
tomcat7-websocket.jar
websocket-api.jar

下面是test.xhtml

<?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:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">

<h:head>
</h:head>
<h:body>
    <h1>Hello World PrimeFaces</h1>

    <h:form enctype="multipart/form-data">
       <p:fileUpload fileUploadListener="#{ftpBean.upload1}"/>
    </h:form>

</h:body>
</html>

FTPBean.java是

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;

@ManagedBean(name="ftpBean")
@ViewScoped
public class FTPBean implements Serializable {
   public void upload1(FileUploadEvent event) {
        System.out.println("Saved files: " + localFile);
   }
}

的web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 id="WebApp_ID" version="2.5">
 <display-name>ATR</display-name>
<context-param>
      <param-name>primefaces.THEME</param-name>
      <param-value>aristo</param-value>
</context-param>
<context-param>
    <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
    <param-value>false</param-value>
</context-param>
<listener>
 <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
 </listener>

<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>

<!-- Faces Servlet -->
 <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>*.jsf</url-pattern>
 </servlet-mapping>
</web-app>

faces-config.xml中

<?xml version="1.0" encoding="UTF-8"?>
 <faces-config 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 http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
 version="2.0">
    <managed-bean>
      <description>UsernName Bean</description>
      <managed-bean-name>user</managed-bean-name>
      <managed-bean-class>demo.User</managed-bean-class>
      <managed-bean-scope>request</managed-bean-scope>
      <managed-property>
         <property-name>name</property-name>
         <property-class>java.lang.String</property-class>
         <value/>
      </managed-property>
   </managed-bean>
</faces-config>

0 个答案:

没有答案