java <ui:debug/> 标签在 Facelets (JSF 2.0) 中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4049531/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
<ui:debug/> tag not working in Facelets (JSF 2.0)
提问by siva636
I am doing a project using JSF 2.0 and Facelets.
我正在做一个使用 JSF 2.0 和 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.
我已阅读文档,该<ui:debug/>
标签在按下 CTRL-SHIFT-D 时会提供有价值的故障排除信息。但这对我永远不起作用。请任何人告诉我我错过了什么。
(I tried with various hotkeys, still no success. eg: <ui:debug hotkey="a"/>
)
(我试过各种热键,仍然没有成功例如:。 <ui:debug hotkey="a"/>
)
回答by BalusC
Ensure that you pick a key which isn't reserved by the webbrowser itself. In case of Firefox, a good choice is x
.
确保您选择的密钥不是网络浏览器本身保留的。对于 Firefox,一个不错的选择是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.
与问题无关,我建议添加一个rendered
属性以确保它不会在生产环境中弹出。例如
<ui:debug hotkey="x" rendered="#{facesContext.application.projectStage == 'Development'}" />
in combination with this in web.xml
结合这个在 web.xml
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
回答by Hinton
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):
在 TEMPLATE 文件的开头,而不是实际页面。我在 web.xml 中添加了以下内容(但已经提到过):
<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).
抱歉回复晚了,但我让它在 Firefox 3 上像这样工作。我认为这不是您的弹出窗口阻止程序。调试弹出窗口通常会被阻止,但您会收到通知(就像我一样)。
回答by liy
One more way:
还有一种方法:
Add the following to web.xml
将以下内容添加到 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)
并添加<ui:debug hotkey="k"/>
到模板的 HTML 部分(不一定在开头)