Sven
Sven

Reputation: 6338

Setting up a JSF project without maven

I used to build my projects with maven. Now I want to do it 'manually'. But I struggle a little bit with directory order and other stuff. I first just created a new dynamic web project in eclipse and added JSF libraries. Now I tried to deploy a hello world page onto a tomcat 7. But jsf-tags are not getting rendered.

Here is my directory structure:

alt text

Anybody has an idea where the mistake is? Am I missing a library or is my structure wrong?

cheers


It finally works! thank's to balusc

Upvotes: 1

Views: 2360

Answers (1)

BalusC
BalusC

Reputation: 1108537

But jsf-tags are not getting rendered.

This means that the FacesServlet isn't mapped in web.xml or you didn't make the URL in browser address bar to match the url-pattern of the FacesServlet. The FacesServlet is the one responsible for parsing JSF tags and doing all the JSF works.

Assuming that the url-pattern of the FacesServlet as definied in web.xml is *.jsf, then you need to open the start.xhtml by http://localhost:8080/fitnessverwaltung/start.jsf instead of http://localhost:8080/fitnessverwaltung/start.xhtml.

You can also change the url-pattern to *.xhtml, then you don't need to worry about this.

<servlet>
    <servlet-name>facesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>facesServlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>

Upvotes: 2

Related Questions