更新selectOneMenu的项目

时间:2013-02-28 23:20:46

标签: file-upload jsf-2 primefaces selectonemenu

我正在尝试在上传文件后更新selectOneMenu的项目。为此,我在文件上传监听器中加载选择项,并在fileUpload组件的update属性中设置selectOneMenu的id,但是甚至不调用文件上载监听器。

我在我上传的http://www.filedropper.com/file-upload

小项目中重现了这个错误

我在JBoss AS7.1.3上使用PrimeFaces 3.5

我找不到我所缺少的东西。有什么想法吗?

提前致谢

1 个答案:

答案 0 :(得分:0)

这是生成的web.xml,包括缺少面的servlet声明和映射,解决了我的问题。

<web-app version="2.5" 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_2_5.xsd">

    <description>File Upload</description>

    <!-- This was missing -->
    <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>

    <!-- File upload -->
    <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>

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>   
        <param-value>Development</param-value>
    </context-param>

    <context-param>
        <param-name>primefaces.THEME</param-name>
        <param-value>glass-x</param-value>
    </context-param>

</web-app>