The FacesContext
is created by the FacesServlet
. This exception means that the FacesServlet
hasn't done its job. You have configured the FacesServlet
to listen on URLs matching pattern *.faces
. Thus you need to ensure that the request URL (the one which appears in browser address bar) matches this URL so that it get invoked.
In other words, you need to open the page by
http://localhost:8080/context/Contato.faces
and not by
http://localhost:8080/context/Contato.jsp
Unrelated to the concrete problem, I'm not sure what "PrimeFaces" is doing in your question title, but I just wanted to warn that PrimeFaces doesn't support JSP at all. It supports only its successor Facelets (XHTML). Using PrimeFaces tags for Facelets in a JSP file instead of a Facelets file would only cause them being interpreted as plain vanilla HTML.