2012-05-04 113 views
0

我收到了一個項目,多行類似如下的:爲什麼我不能調用UIComponent.setValueExpression()?

HtmlOutputText content = new HtmlOutputText(); 
ValueBinding vb = dashBoardBean.getApplication() 
    .createValueBinding(columnas[cont][1]); 
content.setValueBinding("value", vb); 

Eclipse中使用Java 5,將其標記爲棄用(兩班ValueBinding和方法setValueBinding)。

所以我看了API for HtmlCommandLink.setValueBinding()(它實際上是在UIComponentBase),並發現這一點:

已過時。這已被替換爲UIComponent.setValueExpression(java.lang.String, javax.el.ValueExpression)

所以我改變了最後一行代碼如下:

content.setValueExpression("value", null); 

但現在我得到一個編譯錯誤。

我也試過:

UIComponent uic; 
uic.setValueExpression("", null); 

並得到了同樣的錯誤:

The type javax.el.ValueExpression cannot be resolved. It is indirectly referenced from 

所需的.class文件

那是錯誤的含義是什麼?我該如何解決它?

+0

這意味着它生成一個'',並且第二次執行'> –

+0

@ Luiggi Mendoza錯誤是編譯器錯誤。 Eclipse強調了紅色。我無法執行代碼。 –

+0

你是什麼JSF版本? –

回答

2

您需要在類路徑上使用JSF 1.2(或更高版本)的jar包。

相關問題