This repository has been archived by the owner. It is now read-only.

Debugging RichFaces

Brian Leathem edited this page Feb 21, 2014 · 1 revision

Debugging RichFaces 4/5 Issues

Prepare for Debugging

Updated files

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="richfaces-showcase"
    version="3.0">

    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>
    <context-param>
        <param-name>org.richfaces.resourceOptimization.enabled</param-name>
        <param-value>false</param-value>
    </context-param>
</web-app>

my-facelet.xhtml:

<a4j:log mode="console" level="DEBUG" />
<ui:debug hotkey="0" />

OR BETTER:

<c:if test="#{initParam['javax.faces.PROJECT_STAGE'] eq 'Development'}">
    <a4j:log mode="console" level="DEBUG" />
    <ui:debug hotkey="0" />
</c:if>

Check-List

  1. check server console

  2. check browser console

Server Console

This is rather straight-forward, just check whether some JSF or RichFaces errors or warnings aren’t indicated in a log.

Browser Debugging

  1. Open a Dev Tools (see Dev Tools later) (usually F12)

  2. check Console tab (if you placed <a4j:log /> into a page, you will see RichFaces/JSF logging into a browser console)

  3. check a JSF component-tree structure in <ui:debug /> (you can open it using Ctrl+Shift+0 (zero!))

Debugging AJAX Requests

First, you need to check request and response, you can use either output of <a4j:log /> or Network tab.

In the Network tab, see that the XML response particular updates for given part of the page (<update id="clientId" />).

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.