17

I am doing a project using JSF 2.0 and Facelets.

I have read documentations that the <ui:debug/> tag gives valuable troubleshooting information upon pressing CTRL-SHIFT-D. But this never works for me. Please anyone tell me what am I missing.

(I tried with various hotkeys, still no success. eg: <ui:debug hotkey="a"/>)

siva636
  • 16,109
  • 23
  • 97
  • 135

3 Answers3

31

Ensure that you pick a key which isn't reserved by the webbrowser itself. In case of Firefox, a good choice is x.

<ui:debug hotkey="x" />

See also:


Unrelated to the problem, I recommend to add a rendered attribute to ensure that it won't pop in a production environment. E.g.

<ui:debug hotkey="x" rendered="#{facesContext.application.projectStage == 'Development'}" />

in combination with this in web.xml

<context-param>
    <param-name>javax.faces.PROJECT_STAGE</param-name>
    <param-value>Development</param-value>
</context-param>
Community
  • 1
  • 1
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • Nothing is happening in Firefox if I use the tag as: and then press CRTL+SHIFT+k when page is displayed. I am sure I am terribly missing something, but don't know what! – siva636 Oct 29 '10 at 12:16
  • 1
    Maybe you have a too restrictive popup blocker. – BalusC Oct 29 '10 at 12:18
  • Hang on, which context-param is the right one: facelets.DEVELOPMENT or javax.faces.FACELETS_DEVELOPMENT? – Joshua Davis Dec 15 '11 at 15:37
  • 1
    @Joshua: `facelets.XXX` are Facelets 1.x specific and `javax.faces.FACELETS_XXX` are Facelets 2.x specific (which became part of JSF 2.x). The `facelets.XXX` are deprecated in JSF 2.x, but still backwards compatible. – BalusC Dec 15 '11 at 15:42
  • Okay, I'll switch to javax.faces.FACELETS_XXX since I'm using JSF 2.x. I was trying to use this to figure out why I was getting this warning: http://stackoverflow.com/questions/4089076/the-form-component-needs-to-have-a-uiform-in-its-ancestry-suggestion-enclose-t – Joshua Davis Dec 15 '11 at 16:11
12

I couldn't get it to work either until I placed the

<ui:debug hotkey="k" /> 

at the beginning of the TEMPLATE file, not the actual page. And I added the following to web.xml (but that was already mentioned):

<context-param>
    <description>
        Enables the ui:debug facelets tag.
    </description>
    <param-name>javax.faces.FACELETS_DEVELOPMENT</param-name>
    <param-value>true</param-value>
</context-param>

Sorry for the late answer, but I got it to work like this on Firefox 3. I don't think it's your popup blocker. The debug popup will usually get blocked, but you'll get a notification (as did I).

Hinton
  • 2,320
  • 4
  • 26
  • 32
  • 1
    +1 for the point on the placement in the top template page. Also in my case it's working only if the tag is placed at the top-most level – Matteo Oct 19 '11 at 06:34
  • 1
    +1 for the pointing the placement of in the top template page. It Works!!! – Anupam Gupta Dec 16 '12 at 09:08
2

One more way:

Add the following to web.xml

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

And add <ui:debug hotkey="k"/> to HTML part of template (not necessarily to the beginning)

liy
  • 111
  • 1
  • 2