添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
I downloaded the FileUpload component by BalusC from http://dominikdorn.com/?p=169 . This is how I would like to use it - with Primefaces:

Code: Select all

    <h:form id="uploadForm" enctype="multipart/form-data">
        <hh:inputFile id="uploadedFile" value="#{adcUploadBean.uploadFile}"/><br />
        <p:commandButton value="Upload" image="icon-upload" action="#{adcUploadBean.handleFileUpload}" update="detailsPanel"/>
    </h:form>
But when I press the Upload button I get:
WARNING: org.apache.catalina.connector.RequestFacade cannot be cast to net.balusc.http.multipart.MultipartRequest
java.lang.ClassCastException: org.apache.catalina.connector.RequestFacade cannot be cast to net.balusc.http.multipart.MultipartRequest
at net.balusc.jsf.renderer.html.FileRenderer.decode(FileRenderer.java:88)
It works if ajax="false" is added (also with h:commandButton):

Code: Select all

    <h:form id="uploadForm" enctype="multipart/form-data">
        <hh:inputFile id="uploadedFile" value="#{adcUploadBean.uploadFile}"/><br />
        <h:commandButton value="Upload" action="#{adcUploadBean.handleFileUpload}" />
    </h:form>
Checking with Firebug it reveals the issue, in the non-ajax case the pure form-data is sent:
Parts multipart/form-data
uploadForm uploadForm
but with ajax, the form data is missing:
uploadForm=uploadForm&javax.faces.ViewState=6233438609002960529%3A65139178333663670&primefacesPartialRequest=true&uploadForm:j_idt59=uploadForm:j_idt59&primefacesPartialUpdate=detailsPanel I found no way of telling p:commandButton what to send.
It would be really nice if this could be made to work, until the official fileUpload component is fixed.

Code: Select all

Servlet 3.0 is no problem since we need the full Java EE 6 stack anyway (JPA 2.0, EJB 3.1 etc)...
Cool! :shock:
  • ↳   PrimeFaces Theme Designer API
  • ↳   PrimeNG Theme Designer API
  • ↳   PrimeReact Theme Designer API
  • ↳   PrimeVue Theme Designer API
  • UI Kit
  • ↳   Figma
  • Add-Ons
  • ↳   PrimeFlex
  • ↳   PrimeIcons
  • PrimeUI
  • ↳   PrimeUI
  • ↳   Made with Prime
  • ↳   Spanish
  • Premium Layouts and Themes
  • ↳   Freya
  • ↳   Freya - PrimeFaces
  • ↳   Freya - PrimeNG
  • ↳   Freya - PrimeVue
  • ↳   Freya - PrimeReact
  • ↳   Rain
  • ↳   Rain - PrimeFaces
  • ↳   Diamond
  • ↳   Diamond - PrimeFaces
  • ↳   Diamond - PrimeNG
  • ↳   Diamond - PrimeVue
  • ↳   Diamond - PrimeReact
  • ↳   Pandora
  • ↳   Pandora - PrimeFaces
  • ↳   Siberia
  • ↳   Siberia - PrimeFaces
  • ↳   Mirage
  • ↳   Mirage - PrimeFaces
  • ↳   Mirage - PrimeNG
  • ↳   Prestige
  • ↳   Prestige - PrimeFaces
  • ↳   Prestige - PrimeNG
  • ↳   Prestige - PrimeVue
  • ↳   Sapphire
  • ↳   Sapphire - PrimeFaces
  • ↳   Sapphire - PrimeNG
  • ↳   Sapphire - PrimeReact
  • ↳   Sapphire - PrimeVue
  • ↳   Roma
  • ↳   Roma - PrimeFaces
  • ↳   Roma - PrimeNG
  • ↳   Roma - PrimeReact
  • ↳   Roma - PrimeVue
  • ↳   Babylon
  • ↳   Babylon - PrimeFaces
  • ↳   Babylon - PrimeNG
  • ↳   Babylon - PrimeReact
  • ↳   Babylon - PrimeVue
  • ↳   Olympia
  • ↳   Olympia - PrimeFaces
  • ↳   Olympia - PrimeNG
  • ↳   Ecuador
  • ↳   Ecuador - PrimeFaces
  • ↳   Ecuador - PrimeNG
  • ↳   Harmony
  • ↳   Harmony - PrimeFaces
  • ↳   Harmony - PrimeNG
  • ↳   California
  • ↳   California - PrimeFaces
  • ↳   California - PrimeNG
  • ↳   Serenity
  • ↳   Serenity - PrimeFaces
  • ↳   Serenity - PrimeNG
  • ↳   Serenity - PrimeReact
  • ↳   Serenity - PrimeVue
  • ↳   Avalon
  • ↳   Avalon - PrimeFaces
  • ↳   Avalon - PrimeNG
  • ↳   Avalon - PrimeReact
  • ↳   Avalon - PrimeVue
  • ↳   Apollo
  • ↳   Apollo - PrimeFaces
  • ↳   Apollo - PrimeNG
  • ↳   Apollo - PrimeReact
  • ↳   Apollo - PrimeVue
  • ↳   Manhattan
  • ↳   Manhattan - PrimeFaces
  • ↳   Manhattan - PrimeNG
  • ↳   Paradise
  • ↳   Paradise - PrimeFaces
  • ↳   Paradise - PrimeNG
  • ↳   Barcelona
  • ↳   Barcelona - PrimeFaces
  • ↳   Barcelona - PrimeNG
  • ↳   Atlantis
  • ↳   Atlantis - PrimeFaces
  • ↳   Atlantis - PrimeNG
  • ↳   Atlantis - PrimeReact
  • ↳   Atlantis - PrimeVue
  • ↳   Morpheus
  • ↳   Morpheus - PrimeFaces
  • ↳   Morpheus - PrimeNG
  • ↳   Verona
  • ↳   Verona - PrimeFaces
  • ↳   Verona - PrimeNG
  • ↳   Verona - PrimeVue
  • ↳   Poseidon
  • ↳   Poseidon - PrimeFaces
  • ↳   Poseidon - PrimeNG
  • ↳   Poseidon - PrimeVue
  • ↳   Ultima
  • ↳   Ultima - PrimeFaces
  • ↳   Ultima - PrimeNG
  • ↳   Ultima - PrimeReact
  • ↳   Ultima - PrimeVue
  • ↳   Omega
  • ↳   Omega - PrimeFaces
  • ↳   Omega - PrimeNG
  • ↳   Icarus
  • ↳   Legacy
  • ↳   Venture
  • ↳   Olympos
  • ↳   Atlas
  • ↳   Titan
  • ↳   Volt
  • ↳   Adamantium
  • ↳   Rio
  • ↳   Ronin
  • ↳   Spark
  • ↳   Sentinel
  • ↳   Modena
  •