Reputation: 914
I try to reproduce this tutorial http://www.javatutorials.co.in/jsf-2-2-file-upload-example-using-hinputfile/ and I have a big problem: inputFile tag is not available for me.
<h:form id="inputForm" enctype="multipart/form-data">
Upload File
<h:inputFile id="file"
label="file"
value="#{inputBean.part}"
required="true"
requiredMessage="File not selected !!">
</h:inputFile>
<h:message style="color: red" for="file" /><br />
<h:commandButton id="submit"
action="#{inputBean.uploadFile}"
value="upload file" /><br />
<h:outputText value="#{inputBean.statusMessage}"
rendered="#{not empty inputBean.statusMessage}" />
</h:form>
I've seen question Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: inputFile, but in my pom file correct file version are used (2.2.7 > 2.2.4)
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.7</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.7</version>
</dependency>
Here is my project^ https://github.com/Solorad/CheckRulesServer
Upvotes: 2
Views: 5166
Reputation: 914
I found! In .xhtml file I imported wrong tag library. I should used instead. xmlns:h="http://xmlns.jcp.org/jsf/html"
Upvotes: 3