JSF + Primefaces - HTTP 404 error

Asked

Viewed 579 times

0

Good morning,

Web isn’t my thing anymore. I created the project as "Dynamic Web" after converting to Maven because it was giving errors and the way it stopped giving error was described above.

I did not make any configuration other than define *.xhtml in web.xml.

I’m putting some images so you can help with something and even console information.

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

3 answers

1


Try adding these libraries to your pom.xml:

<!-- API de Servlet -->
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

<!-- Implementação do JSF -->
<dependency>
    <groupId>org.glassfish</groupId>
    <artifactId>javax.faces</artifactId>
    <version>2.2.8</version>
    <scope>compile</scope>
</dependency>

1

Make sure that your pom.xml contains the dependency for the JSF, error shows that you cannot find the class of this API.

For every Java EE specification you’re using you also need an implementation.

With example in your Facets screen choices

Choose one of the implementations and add to the dependencies in your pom.xml, followed by the API of your specification.

There are two sites you can use to get dependencies for Maven.

http://mvnrepository.com/
https://search.maven.org/

Examples:

<dependencies>
  <dependency>
      <groupId>javax.faces</groupId>
      <artifactId>jsf-api</artifactId>
      <version>2.1</version>
  </dependency>
  <dependency>
      <groupId>org.richfaces.core</groupId>
      <artifactId>richfaces-core-impl</artifactId>
      <version>4.3.7.Final</version>
  </dependency>
</dependencies>
  • In my case only the very first faces, how would it look? using the "javax.faces?"

  • Take a look at one of the two sites I mentioned, type in Primefaces, choose the version and add. Use the jsf-api next to the primefaces, its implementation. But I leave it here to better understand http://mvnrepository.com/artifact/org.primefaces/primefaces/5.3

0

Solution...

<dependency>

with.sunfaces. jsf-api 2.1.13 with.sunfaces. jsf-impl 2.1.13 wild boar. javax.Servlet-api 3.0.1

Browser other questions tagged

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