警告JSF1090:组件j_idt51的导航案例未解决 [英] WARNING JSF1090: Navigation case not resolved for component j_idt51
问题描述
我在我的应用程序中收到此警告
I'm getting this warning in my application
JSF1090:组件j_idt51的导航案例未解决
JSF1090: Navigation case not resolved for component j_idt51
此警告的原因是什么,我该如何解决?奇怪的是,组件ID j_idt51
不在呈现的页面中.如果我查看生成页面的HTML,则没有ID为j_idt51
的元素.
What is the reason for this warning and how can I resolve it? The strange thing is that the component id j_idt51
is not in the rendered page. If I look to the HTML of the generated page there is no element with id j_idt51
.
推荐答案
每当您在<h:link>
或<h:button>
的outcome
属性中使用(隐式)导航结果时,就会发生此警告,而
This warning will occur whenever you use an (implicit) navigation outcome in the outcome
attribute of <h:link>
or <h:button>
, which does not represent a valid view ID.
例如
<h:link ... outcome="viewIdWhichDoesNotExist" />
<h:button ... outcome="viewIdWhichDoesNotExist" />
此外,<h:link>
将呈现<span>
元素而不是<a>
元素.
Additionally, the <h:link>
will render a <span>
element instead of an <a>
element.
解决方案很明显:使用有效的视图ID,或至少确保所需的视图可通过
The solution is obvious: use a valid view ID, or make at least sure that the desired view is resolveable by ConfigurableNavigationHandler#getNavigationCase()
.
请注意,某些入门者出于未知原因甚至将http://google.com
之类的完整URL用作<h:link>
的结果值:
Note that some starters use for an unknown reason even a full URL like http://google.com
as outcome value of <h:link>
:
<h:link value="Go to Google" outcome="http://google.com" />
然后,这种滥用也将产生确切的警告.您应该使用<h:outputLink>
或仅使用<a>
.
This abuse would then also yield exactly this warning. You should be using <h:outputLink>
or just <a>
instead.
关于缺少与JSF组件具有相同ID的HTML元素,当您未明确指定JSF组件的id
属性时,可能会发生这种情况.然后,JSF组件ID不必最终出现在生成的HTML输出中.为这些组件分配固定的ID应该有助于更好地查明原因.
As to the absence of a HTML element with the same ID as the JSF component, this may happen when you didn't explicitly specify the JSF component's id
attribute. The JSF component ID does then not necessarily end up in the generated HTML output. Assigning those components a fixed ID should help better in nailing down the cause.
这篇关于警告JSF1090:组件j_idt51的导航案例未解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!