problems using inputfile in JSF 2.1

Asked

Viewed 65 times

2

I am using version JSF 2.1 with this artifact below;

<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <version>2.1.21</version>
    <scope>compile</scope>
</dependency>

And I need to use inputfile as shown below;

        <p:outputLabel value="Imagem do Produto" />
        <h:inputFile value="#{cadastroProdutoBean.arquivo}" />

I know it is necessary to use the following tag below;

xmlns:i="http://xmlns.jcp.org/jsf/html"

since I didn’t recognize it, what is wrong? What does it take for me to make the inputfile be recognized on the page?

Update of the post///////////////////////////////////////////////////////

I am having a huge difficulty enabling JSF inputfile, as I have learned that inputfile only works in the JSF project of version 2.2. So I decided to create the Zero project and be able to convert to the latest version as you can see;

inserir a descrição da imagem aqui

But I still have problems and I need help.

1 answer

2


Friend,

When including the line xmlns:**i**="http://xmlns.jcp.org/jsf/html" you named this pool of components with the letter i. So try to use the component with the following tag

<i:inputFile value="#{cadastroProdutoBean.arquivo}" />                       

Browser other questions tagged

You are not signed in. Login or sign up in order to post.