http://javastudy.ru/jsf-2/jsf-hello-world-example-primefaces/

I did everything by this example, but when I run "localhost: 8080", I get a 404 error.

Normal html pages are displayed, but jsf is not.

I looked at many examples on the Internet, I do everything correctly, what could be the problem, tell me, please? Well, the advice where you can read competent information is also suitable :)

  • Is there something in the logs? Traces or errors? Or no-mapped in TC messages? Is the port exactly 8080 and not 8084? Here are some good articles at mkyong.com/tutorials/jsf-2-0-tutorials - Chubatiy
  • In an example like JSF 2.2, and such old stuff as ManagedBean was pulled. Well this is the way. Show your web.xml, faces-config.xml and the composition of the war-archive (with folders, which files are in folders) - Sergey
  • JavaServer Faces The Complete Reference . In Google, several intelligent JSF lovers are searched. Chief BalusC. A couple of Russian names, but they write in the aglitsky, traitors. Chinese / Indians of the mkyong type - memos - no more. And this is at best. It is better to avoid them. - Sergey
  • It is unclear whether the necessary server components for JSF support are included in your project. Without this, Tomcat is designed to support only JSP. Try using GlassFish. - Igor Kudryashov

1 answer 1

Faces Servlet in the above web.xml does not handle .jsf , try calling .xhtml or changing the servlet-mapping to:

 <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.jsf</url-pattern> </servlet-mapping>