【发布时间】:2017-05-15 01:31:45
【问题描述】:
我想知道如何从我的实体 consumable.java 调用这个函数 anystock 并在 xhtml 上使用它。
public String anystock(int value) {
String result = null;
if (value==0)
{
result="Please fill the stock of this device";
}
else if (value<5)
{
result="The stock will be empty ";
}
return result;
}
Xhtml:
</p:column>
<p:column headerText="message" >
<h:outputText value="#{consumable.anystock(consumable.stock)}"/>
</p:column>
这里工作正常,我也收到了一些信息:
<p:column headerText="stock" sortBy="#{consumable.stock}" filterBy="#{consumable.stock}">
<h:outputText value="#{consumable.stock}"/>
</p:column>
错误代码:
javax.servlet.ServletException: Method not found: class entity.Consumable.anystock(java.lang.Integer)
谢谢你的回答
编辑::
感谢您的解决方案
【问题讨论】:
-
请发布消耗品类