JSF2 - ui:debug

Bookmark and Share

Overview

The ui:debug tag could provide detailed information regarding the state of a Facelet view.

After the view is rendered in a Web browser, the developer can press SHIFT-CTRL-D in order to pop up the Facelets debug window that includes a detailed hierarchical dump of the component tree. It also includes the names and values of request parameters, view attributes, request attributes, flash attributes, session attributes, and application attributes.

How it works

Tools used:

  • Tomcat 7.0.27
  • JDK 1.6.0_25
  • Eclipse 3.7
  • Mojarra 2.1.13
  • Maven 3.0.3

Create JSF 2 Project using Maven

Create a JSF 2 web project using Maven, please refer to previous example: "JSF2 - ui:insert, ui:define, ui:include, ui:composition".

JSF 2 Facelets Template

Add the ui:debug tag in a Facelets page, a debug component is added to the component tree for that page.

BasicTemplate.xhtml

Run the JSF 2 Application

Access to http://localhost:8080/jsf2practice/login.jsf.

Press CTRL+SHIFT+d, JSF 2 opens a window and displays the state of the component tree and the application's scoped variables:

JSF 2 Image
JSF 2 Image
JSF 2 Image

Related Tutorials