JSF tags are not being rendered (no rendering)

Spread the love

(original from stackoverflow)

Two advices:

  1. Update the URL pattern for Faces Servlet. The default configuration can be for *.jsp (no need to use *.faces or something else. Still, I would recommend using *.xhtml.
  2. JSF 2 works with Facelets, so you don’t need to use old JSP anymore. By reading your login.jsp page content, you can just rename the extension from jsp to xhtml and it will work.

Based on these, the web.xml will look like this:

<web-app>
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
    <welcome-file-list>
        <welcome-file>login.xhtml</welcome-file>
    </welcome-file-list>
</web-app>

Comments

comments

Leave a Reply