I have done a couple projects using JSF and facelets, but it has been awhile since I set up a new one from scratch. I think I have all the pieces in place but the facelet will not render. Can anyone tell me what I am missing? The last piece of code is the resulting HTML page. The <application:signIn></application:signIn> line is where the facelet is supposed to render, but some link must be missing.
Thank you in advance!
Jon
faces-config.xml
web.xml
template.jsf
signIn.jsf (facelet)
application.taglib.xml
signIn.jsf (main page)
Resulting page
Thank you in advance!
Jon
faces-config.xml
XML:
<!DOCTYPE faces-config PUBLIC
"-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
"[URL unfurl="true"]http://java.sun.com/dtd/web-facesconfig_1_0.dtd">[/URL]
<faces-config>
<application>
<locale-config>
<default-locale>en</default-locale>
</locale-config>
<view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
</application>
<!-- Navigation Forwarding -->
<navigation-rule>
<from-view-id>/signIn.jsf</from-view-id>
<navigation-case>
<description></description>
<from-outcome>success</from-outcome>
<to-view-id>/signIn.jsf</to-view-id>
</navigation-case>
<navigation-case>
<description></description>
<from-outcome>retry</from-outcome>
<to-view-id>/signIn.jsf</to-view-id>
</navigation-case>
</navigation-rule>
</faces-config>
web.xml
XML:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns="[URL unfurl="true"]http://java.sun.com/xml/ns/javaee"[/URL] xmlns:web="[URL unfurl="true"]http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"[/URL] xsi:schemaLocation="[URL unfurl="true"]http://java.sun.com/xml/ns/javaee[/URL] [URL unfurl="true"]http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"[/URL] id="WebApp_ID" version="3.0">
<display-name>TicketingAdmin</display-name>
<welcome-file-list>
<welcome-file>signIn.jsf</welcome-file>
</welcome-file-list>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.jsf</param-value>
</context-param>
<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>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.FACELETS_LIBRARIES</param-name>
<param-value>
/WEB-INF/facelets/tags/application.taglib.xml
</param-value>
</context-param>
</web-app>
template.jsf
HTML:
<html xmlns:jsp="[URL unfurl="true"]http://java.sun.com/JSP/Page"[/URL]
xmlns:ui="[URL unfurl="true"]http://java.sun.com/jsf/facelets"[/URL]
xmlns:f="[URL unfurl="true"]http://java.sun.com/jsf/core"[/URL]
xmlns:h="[URL unfurl="true"]http://java.sun.com/jsf/html"[/URL]
version="2.0">
<body>
<ui:composition>
<html>
<head>
<title>
<ui:insert name="title">Ticketing System</ui:insert>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<ui:insert name="stylesheet"></ui:insert>
</head>
<body>
<f:view>
<div id="UI" class="userInterface">
<div id="Hdr_UI" class="header">
<h1 class="title"><ui:insert name="uiTitle">Ticketing System</ui:insert></h1>
<div class="logo"></div>
<div id="Loader" class="loader" style="display:none;">
<div id="Ldr_Text" class="data datLoaderText">Loading...</div>
</div>
<span class="tagLine"><ui:insert name="uiTagLine">Facility name goes here</ui:insert></span>
<div class="navigation">
</div>
</div>
<ui:insert name="uiApplications"></ui:insert>
<div id="Ftr_UI" class="footer">
<ui:insert name="uiFooter"></ui:insert>
</div>
</div>
<ui:insert name="uiScriptModels"></ui:insert>
<ui:insert name="uiScriptBehaviors"></ui:insert>
</f:view>
</body>
</html>
</ui:composition>
</body>
</html>
signIn.jsf (facelet)
HTML:
<html xmlns:jsp="[URL unfurl="true"]http://java.sun.com/JSP/Page"[/URL]
xmlns:c="[URL unfurl="true"]http://java.sun.com/jstl/core"[/URL]
xmlns:ui="[URL unfurl="true"]http://java.sun.com/jsf/facelets"[/URL]
xmlns:f="[URL unfurl="true"]http://java.sun.com/jsf/core"[/URL]
xmlns:h="[URL unfurl="true"]http://java.sun.com/jsf/html"[/URL]
version="2.0">
<body>
<ui:composition>
<div id="App_SignIn" class="application">
<div id="PV_Application" class="module panelView">
<div class="header">
<h2 class="title">Ticketing Administration</h2>
</div>
<div id="Cnt_Main" class="content">
Sign in here...
</div>
<div class="footer"></div>
</div>
<div id="Frozen_App_Ticketing" class="frozen" style="display:none;"></div>
</div>
</ui:composition>
</body>
</html>
application.taglib.xml
XML:
<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"facelet-taglib_1_0.dtd">
<facelet-taglib>
<namespace>[URL unfurl="true"]http://ej.com/mf/application</namespace>[/URL]
<tag>
<tag-name>signIn</tag-name>
<source>application/signIn.jsf</source>
</tag>
</facelet-taglib>
signIn.jsf (main page)
HTML:
<html xmlns:jsp="[URL unfurl="true"]http://java.sun.com/JSP/Page"[/URL]
xmlns:ui="[URL unfurl="true"]http://java.sun.com/jsf/facelets"[/URL]
xmlns:f="[URL unfurl="true"]http://java.sun.com/jsf/core"[/URL]
xmlns:h="[URL unfurl="true"]http://java.sun.com/jsf/html"[/URL]
xmlns:c="[URL unfurl="true"]http://java.sun.com/jstl/core"[/URL]
xmlns:application="[URL unfurl="true"]http://ej.com/mf/application"[/URL]
version="2.0">
<body>
<ui:composition template="/WEB-INF/application/template.jsf">
<ui:define name="uiTagLine">
</ui:define>
<ui:define name="uiScriptModels">
</ui:define>
<ui:define name="uiScriptBehaviors">
</ui:define>
<application:signIn />
<ui:define name="uiApplications">
<application:signIn />
</ui:define>
</ui:composition>
</body>
</html>
Resulting page
HTML:
<html>
<head>
<title>Ticketing System
</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
</head>
<body>
<div id="UI" class="userInterface">
<div id="Hdr_UI" class="header">
<h1 class="title">Ticketing System</h1>
<div class="logo"></div>
<div id="Loader" class="loader" style="display:none;">
<div id="Ldr_Text" class="data datLoaderText">Loading...</div>
</div>
<span class="tagLine"></span>
<div class="navigation">
</div>
</div>
<application:signIn></application:signIn>
<div id="Ftr_UI" class="footer">
</div>
</div>
</body>
</html>