Create a new application and a new project in Jdeveloper. Download the following libraries:
- The facelets library: facelets-1.1.11.
- Adf facelets library: adf-facelets.jar.
Unzip the facelets library. I’ve copied the adf facelets jar to the facelets folder, this is not necessary, but keeps things together.
Open project properties of your view project, go to libraries, add a new facelets library. Include the following four jars:
In libraries make sure you have to following four libraries added:

Next go to the JSP Tag libraries section and add the tag libraries for ADF Faces components, ADF Faces HTML, JSF Core and JSF HTML.
Add the following to public_html/WEB-INF/web.xml
<context -param> <param -name>oracle.adf.view.faces.ALTERNATE_VIEW_HANDLER</param> <param -value>com.sun.facelets.FaceletViewHandler</param> </context> <context -param> <param -name>javax.faces.DEFAULT_SUFFIX</param> <param -value>.xhtml</param> </context>
Add the following servlet mapping to web.xml, otherwise the url opened in your browser will not be correct when you run the page from jdeveloper.
<servlet -mapping> </servlet><servlet -name>Faces Servlet</servlet> <url -pattern>*.xhtml</url>
Next, create a xhtml page. If you specify a .xhtml extension in the html wizard, it will not use the correct extension you specify. Instead, jdeveloper will add .html after your file name.
To solve this you can either rename the file using the file menu of jdeveloper, or you can create general file, instead of an html file.
Next edit page1.xhtml
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:af="http://xmlns.oracle.com/adf/faces"
xmlns:afh="http://xmlns.oracle.com/adf/faces/html">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
<title>untitled1</title>
</head>
<body>
<ui :composition template="/WEB-INF/layout/layout.xhtml">
</ui><ui :define name="header">
<h
utputText value="My header"/>
</ui>
<ui :define name="content">
<af
utputText value="My content"/>
<h
utputText value="My Footer"/>
</ui>
</body>
</html>
Finally well create a layout page which can be used to define the overall laypout foryou’re your pages. Add the following to public_html/WEB-INF/layout/layout.xhtml:
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></meta>
<title>layout</title>
</head>
<body>
<div id="header">
<ui :insert name="header"/>
</div>
<div id="content">
<ui :insert name="content"/>
</div>
</body>
</html>
You can now run your page by selecting the page and rightclick run:





March 9th, 2007 at 00:04:10
Cool Andrej. Thank you very much. I was planning on evaluating integration between the two. I will try that and it will certainly save me a lot of time !
March 9th, 2007 at 01:02:33
[...] Original post by Andrej Koelewijn [...]
September 18th, 2007 at 15:31:55
thanks, Andrej, very helpful. anybody has this working with JSF1.2?
September 22nd, 2007 at 00:57:03
one issue I encountered with this setup is that facelet custom tags (taglibs referenced in facelets.LIBRARIES context-param in web.xml) cannot be called inside of ADF tags
September 26th, 2007 at 00:23:14
update: facelets and ADF now respect each other: all I had to do was replace the with
in the templates and pages, and I wrapped my custom facelets tag libraries in ,
and the world is happy …
September 26th, 2007 at 00:25:21
sorry, lost the tags:
September 26th, 2007 at 00:26:11
afh:html xmlns
af:subform
November 26th, 2008 at 15:05:52
The Adf facelets library “adf-facelets.jar” was the key to success! Without this Weblog, i swould still search for a solution… Thanx
January 20th, 2010 at 22:12:33
Excellent work! Just congrats and thank you for providing such useful info to the community!