JSF2.0 相当于 HTML 锚标记的是什么
当我按如下方式使用 h:link
标记时,JSF 系统报告为 此链接已禁用,因为导航案例无法匹配。
<h:link rendered="#{empty applicationScope.rendered ? false : true}" disabled="#{applicationScope.disabled eq 'true' ? true : false}" outcome="http://www.myblogname.blogspot.com/" >
<h:graphicImage url="#{applicationScope.url}" alt="#{applicationScope.alt}" title="#{applicationScope.title}" styleClass="rGap ui-corner-all" />
</h:link>
它似乎正在搜索内部导航案例,但如何指定外部超链接?
问题摘要: 以下 HTML 的 JSF 等效项是什么?
<a href="http://www.amazon.com" > Amazon </a>
When I use the h:link
tag as follows, the JSF system reports as This link is disabled because a navigation case could not be matched.
<h:link rendered="#{empty applicationScope.rendered ? false : true}" disabled="#{applicationScope.disabled eq 'true' ? true : false}" outcome="http://www.myblogname.blogspot.com/" >
<h:graphicImage url="#{applicationScope.url}" alt="#{applicationScope.alt}" title="#{applicationScope.title}" styleClass="rGap ui-corner-all" />
</h:link>
It seems it is searching for an internal navigation case, but how can I specify an external hyperlink?
Summery of the question:
What is the JSF equivalent of the following HTML?
<a href="http://www.amazon.com" > Amazon </a>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
h:outputLink
标签。使用 value 属性指定渲染的href
。应该可以像这样调整您的示例代码:
注意:我不认为h:outputLink
标记有disabled
属性,因此将其设置为 true 或 false(如上面的代码示例中所示)可能不会产生效果。您必须尝试一下才能看到。正如 @Matteo 在评论中指出的那样,
disabled
属性应该与h:outputLink
标记一起使用。Try using the
h:outputLink
tag. Use value attribute to specify the renderedhref
.It should be possible to adapt your sample code like this:
Note: I don't think theh:outputLink
tag has adisabled
attribute, so setting it to true or false (like in your code sample above) may not have an effect. You'll have to try it and see.As @Matteo brought out in a comment, the
disabled
attribute should work with theh:outputLink
tag.