나는 웹 응용 프로그램이 실행이 : 파일 업로드 PrimeFaces 4.0, 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>
'IDE 또는 브라우저 콘솔'에 오류가 있습니까? 게시 한 코드는 매우 직관적으로 보이므로 같은 코드를 구현하면 작동합니다. – SRy
Nothing :) JS 콘솔에서 얻을 수있는 것 : _ xml version = '1.0'encoding = 'UTF-8'?> partial-response> _ –
Domen91
오늘 저는 아파치 라이브러리와 PF 라이브러리만으로 빈 웹 프로젝트를 테스트하고 같은 결과를 얻었습니다. 결과 : ( – Domen91