JSF Spy

JSF Spy is a new debug/performance/trace tool that takes a "state-snap" before and after every phase of every JSF request.  A "state-snap" is a toString() snapshot of all scoped data in a JSF application.  Also, JSF Spy records performance and HttpRequest information like headers, request params, and cookies.

 

It keeps all the data for all the HttpSessions, even those that expired.  So, you can browse the data for all users.

Installation of JSF Spy JAR

JSFSpy requires a Servlet 3.0 container along with JSF 2.0.  JBoss AS 6 milestone 2 is known to work well.  The latest Glassfish should also be able to run JSFSpy, but it has not been tested.

 

To install JSF Spy, you only need to copy the JSF Spy jar to your WEB-INF/lib directory.  This will allow you to access JSF Spy's collected data from any java code running inside the web app, including JSFUnit tests.  JSF Spy does not depend on JSFUnit, so you are not required to have JSFUnit installed.  You only need the single JSF Spy jar.

 

Starting the JSF Spy UI

The JSF Spy UI is a collection of Facelets (xhtml files) that allow you to browse all the data that JSF Spy has collected.

 

To start the UI, you will need to go to the /jsfspy/index.xhtml facelet.  To do this, you will need to know how your facelets are mapped to your JSF application.  So the URL will probably be like one of these:

 

http://localhost:8080/myjsfapp/jsfspy/index.jsf

http://localhost:8080/myjsfapp/jsfspy/index.faces

http://localhost:8080/myjsfapp/jsfspy/index.seam

http://localhost:8080/myjsfapp/PathMapToFacesServlet/jsfspy/index.xhtml

 

JSFSpy WARlet Plug-Ins

JSFSpy allows anyone to extend its functionality via WARlets.  JSFSpy WARlets