我真的被这个问题难住了。 我们有RichFaces的项目。 我想用的标签,而不是因为我不喜欢的文件被传递到bean的方式。 我们的项目运作非常良好。 我相信我有所有的POM所需depedencys的,但我甚至手动添加了几个通过阅读后如何设置项目,以支持H:2.2 inputfile中的JSF @BalusC,所以我说
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>1.2_15</version>
</dependency>
<dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1</version>
</dependency>
这里是我的网页:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:rich="http://richfaces.org/rich"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:b="http://richfaces.org/sandbox/bootstrap"
template="/template.xhtml">
<ui:define name="metadata">
</ui:define>
<ui:define name="content">
<h:inputHidden id="active-bean-name" value="dataloader" />
<h:form>
<h:form id="form" enctype="multipart/form-data">
<rich:fileUpload></rich:fileUpload>
<h:inputFile id="file" value="#{DataLoaderBean.file}"/>
<h:commandButton value="Upload"
action="#{DataLoaderBean.upload}"/>
</h:form>
</h:form>
</ui:define>
</ui:composition>
任何帮助将不胜感激。