Developer Support

Developer support means the functionality provided by the generated web application to debug and analyze the structure and behavior of a web application. It is activated like this:

Setting the project stage ‘Development’ for the web application:

...

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>

...

Let isLayoutDeveloperBarRendered() in AppLayoutCustomizationBean return true:

@ManagedBean(name="layoutCustomizationBean2")
@RequestScoped
public class AppLayoutCustomizationBean implements LayoutCustomizationBean.LayoutCustomizationI {

    ...

    @Override
    public Boolean isLayoutDeveloperBarRendered(UIViewRoot view) {
        return Boolean.TRUE;
    }

    ...
}

An alternative to isLayoutDeveloperBarRendered() is to set a context parameter in web.xml:

<context-param>
    <param-name>layout.developer.bar.rendered</param-name>
    <param-value>true</param-value>
</context-param>

But using isLayoutDeveloperBarRendered() has the advantage that you can easily change the implementation of that method during development and let tools like JRebel reload that change instantly. With web.xml this wouldn’t work.

Note

When the PROJECT_STAGE is not set to Development and the application is not accessed by means of a URL that uses localhost, no developer support is available at all. This is true even when you try to enable the developer support by means of setting the context parameter layout.developer.bar.rendered to true in web.xml or by letting isLayoutDeveloperBarRendered() in AppLayoutCustomizationBean return true. Thanks to this mechanism it is impossible that any developer support functionality will be running in a production environment.

The Developer Bar

The developer bar is a part of a web page that is displayed between a top menu (layout section ‘north’) and the main part of a page (layout section ‘center’). It ships the following functionality (from left to right). Every change in input components need to be acknowledged by clicking on one of the developer bar’s buttons.

  1. basic information about the page and the session
    • the project stage
    • the number of instances of UIComponent for the page
    • whether there is an active session
    • the id of the active session
  2. a menu to quickly navigate to any of the web app’s pages
  3. template and theme selection
    • select a theme from a list of available themes
    • select a template from a list of available templates
  4. control light, dark and gradient menu options for the premium layout PRIMEFACES_CALIFORNIA
  5. control layout variants (works only when the current page provides layout variants)
  6. some debugging options
    • enable performance measurement
    • enable display of model data (comes from [layout-Name]BeanDevTooltip.java)
    • control developer bar visibility
    • activation of <p:log>
  7. display collected performance logs as an overlay