JSF + PrimeFaces - HTTP Error 404

0

Good morning,

Web is not my beach but I want to learn. I created the project as "Dynamic Web" then convert to Maven because it was giving some errors and way that stopped from giving error was described above.

I did not make any settings other than set * .xhtml in web.xml.

I'm putting some pictures so you can help with something and even the console information.

    
asked by anonymous 14.12.2015 / 15:40

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>
    
14.12.2015 / 16:28
1

Make sure your pom.xml contains the dependency for the JSF API. , in error it shows that it can not find the class of this API.

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

  

With an example in your Facets screen choices

Choose one of the implementations and add them in 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>
    
14.12.2015 / 16:30
0

Solution ...

<dependency>

com.sun.faces   jsf-api   2.1.13   com.sun.faces   jsf-impl   2.1.13   javax.servlet   javax.servlet-api   3.0.1

    
14.12.2015 / 17:00