2013-10-16 7 views
1

나는 웹 응용 프로그램이 실행이 : 파일 업로드 PrimeFaces 4.0, JSF 인 Mojarra 2.2.3 및 제이보스 베타 작동하지 않습니다 1

  • JSF 인 Mojarra 2.2.3 (제이보스에서 베타 1

    • 제이보스)
    • Primefaces 4.0
    • rewrite-servlet-2.0.7.Final/rewrite-config-prettyfaces-2.0.7.Final
    • 공유지-IO-2.4/평민 - 파일 업로드 - 1.3

    파일 업로드 구성 요소에 문제가 있습니다 (고급 및 단순 모드가 작동하지 않음, 내 업로드 안 함)).

    동일한 작업은 rewrite-servlet-2.0.7.Final/rewrite-config-prettyfaces-2.0.7.Final 라이브러리없이 실행됩니다.

    내 upload.xhtml 파일 :

    <h:form prependId="false" id="formLateralUpload" enctype="multipart/form-data"> 
        <h:panelGrid columns="1" cellpadding="5"> 
         <p:fileUpload mode="advanced" multiple="true" update="@widgetVar(msg)" 
          fileUploadListener="#{test.upload}" auto="true" sizeLimit="10500000"/> 
        </h:panelGrid> 
    </h:form> 
    

    내 콩 :

    @ManagedBean(name = "test") 
    @ViewScoped 
    public class Test { 
        private UploadedFile  file; 
    
        public UploadedFile getFile() { 
         return file; 
        } 
    
        public void setFile(UploadedFile file) { 
         this.file = file; 
        } 
    
        public void upload(FileUploadEvent event) { 
         System.out.println("inside upload()"); 
        } 
    } 
    

    의 web.xml :

    <?xml version="1.0" encoding="UTF-8"?> 
    <web-app 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://xmlns.jcp.org/xml/ns/javaee" 
        xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" 
        id="test" 
        version="3.1"> 
        <display-name>test</display-name> 
        <welcome-file-list> 
         <welcome-file>/</welcome-file> 
        </welcome-file-list> 
    
        <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> 
         <dispatcher>REQUEST</dispatcher> 
         <dispatcher>FORWARD</dispatcher> 
        </filter-mapping> 
    
        <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>/faces/*</url-pattern> 
         <url-pattern>*.xhtml</url-pattern> 
        </servlet-mapping> 
    
        <context-param> 
         <param-name>javax.faces.PARTIAL_STATE_SAVING</param-name> 
         <param-value>true</param-value> 
        </context-param> 
    
        <error-page> 
         <exception-type>javax.faces.application.ViewExpiredException</exception-type> 
         <location>/redirect</location> 
        </error-page> 
    </web-app> 
    
  • +0

    'IDE 또는 브라우저 콘솔'에 오류가 있습니까? 게시 한 코드는 매우 직관적으로 보이므로 같은 코드를 구현하면 작동합니다. – SRy

    +0

    Nothing :) JS 콘솔에서 얻을 수있는 것 : _ _ – Domen91

    +0

    오늘 저는 아파치 라이브러리와 PF 라이브러리만으로 빈 웹 프로젝트를 테스트하고 같은 결과를 얻었습니다. 결과 : ( – Domen91

    답변

    0

    I Wildfly 8.1, PrimeFaces 5.1, 예쁜 얼굴 및 파일 업로드와 동일한 문제가 있습니다. Tomcat에서이 작업을 수행 할 수있는 HACK이 있지만 언젠가는 찾을 수 없습니다. PrettyFaces가 올바르게 작동하지 못하게하는 멀티 파트 게시물 요청에 나쁜 영향을 미치는 것 같습니다. 실제 문제를 수정하는 대신 Tomcat에 해킹이 존재하기 때문에 Undertow/Wildfly로 다시 푸시하는 것처럼 보입니다.

    제이보스 토론 : http://ocpsoft.org/support/topic/pretty-primefaces-fileupload/

    톰캣 해킹 : http://ocpsoft.org/support/topic/split-prettyfaces-anchor-with-primefaces-file-upload-not-working/

    나는이 차단 도로와 나는 정말 하나 PrettyFaces을 추출 할 수 없습니다, PrimeFaces - 파일 업로드 (I 배경 아약스/HTML5 업로드 필요) 또는 Wildfly ... "iframe/단순 모드 사용"이외의 제안이있는 사용자라면 누구나 환영 할 것입니다.