【问题标题】:What's the difference between p:commandlink and h:commandlink? [duplicate]p:commandlink 和 h:commandlink 有什么区别? [复制]
【发布时间】:2013-06-25 03:44:14
【问题描述】:

Primefaces 命令链接和 jsf 命令链接有什么区别?

当我简单地将 p:commandLink 更改为 h:commandLink 时,

<p:commandLink action="#{actionBean.action(var)}"
value="#{valueBean.getValue(var.attribute)}"
styleClass="#{var.type}" />

Eclipse 在action="#{actionBean.action(var)}" and value="#{valueBean.getValue(var.attribute)}" 提示错误

方法必须有签名“String method(), String method(String), String method(String, String), String 方法(字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串, 字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串, 字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串 方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串),字符串 方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串),字符串方法(字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串, 字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串,字符串)”但有签名“字符串 方法(布尔值)"

actionBean.action(var) 像“index”一样返回一个要重定向的页面;

即使 Eclipse 提示错误,h:commandLink 版本在运行时也能完美运行。真的很困惑。非常感谢。

【问题讨论】:

  • &lt;h:commandButton&gt; 是一个原生 JSF 组件,它将呈现一个简单的 &lt;input type="submit"&gt;,而 &lt;p:commandButton&gt; 是一个 PrimeFaces 组件,它为这个按钮添加了 ajax 功能。当然,这是一个粗略的解释,也许您想要更详细的技术。
  • 是的,无论如何谢谢你
  • 如果这是您的目的,那么请编辑显示您的原因的问题,否则它可能会因为不做进一步的修改而被关闭,而不仅仅是希望其他人为您做。
  • 嗯,我还在研究这个话题,只是想看看有没有人做过..
  • 你为什么要搜索这个?你的动机是什么?只是为了满足你的好奇心?

标签: jsf primefaces


【解决方案1】:

这是一个 Eclipse 问题。不是你的代码问题。您可以通过在 Eclipse 中将 Method expression signature incompatibility 设置为 warning 或 ignore 来禁用它! Here你会发现细节。

【讨论】:

  • 如果您发现重复,只需投票关闭作为重复。
猜你喜欢
  • 2015-11-23
  • 2013-02-13
  • 2011-04-26
  • 2016-09-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-11
相关资源
最近更新 更多