Installation

After downloading FacesTrace and adding it to your classpath, following steps are necessary to start using the library:

web.xml

Make sure the faces servlet mapping supports *.jsf

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

JSF Pages

With JSP

In case you're still not using Facelets(you should be) and using JSP as the markup of JSF pages, the taglib for FacesTrace is;

<%@ taglib uri="http://facestrace.sourceforge.net" prefix="ft"%>

With Facelets

FacesTrace facelets taglib definition is included in the FacesTrace distribution jar, Facelets should automatically pick it up so no configuration is necessary at this point. The xml namespace declaration would be;

<html xmlns="http://www.w3.org/1999/xhtml" 
        xmlns:h="http://java.sun.com/jsf/html" 
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets" 
        xmlns:ft="http://facestrace.sourceforge.net">
				

The component

FacesTrace has only one component called FacesTrace, placing the component at the end of your page should just work

<ft:trace />
				

Disable/Enable Trace

Although FacesTrace is great in the development process, it should be disabled in a production environment. Following init parameter turns FacesTrace off.

web.xml

<context-param>
	<param-name>com.prime.facestrace.DISABLE_TRACE</param-name>
	<param-value>true or false</param-value>
</context-param>
				

Log4J Appender

This step is only necessary if you're willing to use FacesTrace's Logging support. FacesTrace uses it's own log4j appender to collect the logs. In order to use this feature, the appender must be registered in the log4j configuration. An example log4j.xml looks like;

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration PUBLIC "-//LOG4J" "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <appender name="FACESTRACE"
        class="com.prime.facestrace.logging.FacesTraceAppender">
    </appender>
    <logger name="your.app">
        <level value="DEBUG" />
    </logger>
    <root>
        <level value="INFO" />
        <appender-ref ref="FACESTRACE" />
    </root>
</log4j:configuration>