[英]primefaces fileupload not showing up
在我的web.xml中
<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>
在我的xhtml上
<h:form enctype="multipart/form-data">
<p:fileUpload fileUploadListener="#{testController.handleFileUpload}"
mode="advanced"
update="messages"
sizeLimit="100000"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>
<p:growl id="messages" showDetail="true"/>
</h:form>
已經導入了commons-fileupload和commons-io庫。
使用JSF 2.0和Primefaces 3.5
我的問題是,上傳布局未顯示,沒有可供選擇,上傳或取消的按鈕。
代碼參考在這里: http : //www.primefaces.org/showcase/ui/file/upload/single.xhtml
頁面的其余部分可能有問題。
您是否有h:head而不是head和h:body而不是body ? 如果不這樣做,可能會導致組件無法正確渲染。
我將其留為評論,但我的觀點還不夠
您在使用MyFaces還是Mojarra? Primefaces團隊開發的想法僅適用於Mojarra,例如,其Ajax實施不適用於Composite:clientbehavior。
嘗試使用Mojarra。
我有同樣的問題。 我花了幾天時間,終於意識到我在我的lib RICHFACES和PRIMEFACES中,所以我決定刪除RICHFACES,並且該組件開始正確渲染! 看看這個...
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.