警告 JSF1090:组件 j_idt51 的导航案例未解决 [英] WARNING JSF1090: Navigation case not resolved for component j_idt51

查看:10
本文介绍了警告 JSF1090:组件 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> 的 outcome 属性中使用(隐式)导航结果时,都会出现此警告;<h:button>,它们代表一个有效的视图 ID.

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> 将呈现 元素,而不是 <a> 元素.

Additionally, the <h:link> will render a <span> element instead of an <a> element.

解决方案很明显:使用有效的视图 ID,或者至少确保所需的视图可以通过 ConfigurableNavigationHandler#getNavigationCase().

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆