0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Cannot apply expression operators to method bindingとなった時の対応方法

Posted at
  • 環境
    • CentOS Linux release 7.8.2003 (Core)
    • Eclipse IDE for Enterprise Java Developers Version: 2020-03 (4.15.0)
    • openjdk version 11.0.7

事象 : JSFの「!(否定)」でなぜか怒られている

hoge.xhtml
<h:commandButton styleClass="btn hidden_btn"
  value="#{controller.labelBean.selectBtnLabel}"
  rendered ="#{!controller.isDispSelectBtn(index)}"> <!-- ここがエラー対象 -->
エラーメッセージ
Cannot apply expression operators to method binding

原因 : 書き方がいまいち?

英語のサイトが多くていまいちちゃんとした原因わからず。
誰か説明してほしい・・・

対応1 : メッセージを非表示にする

既存のプロジェクトでの問題なので今回はこの対応

  1. [Window] > [Preferences]でダイアログを開く
  2. [Web] > [JavaServer Faces Tool] > [Validation]
  3. [General Problems]にある[Applying method operator to binding]で「Ignore」を選択
  4. [Apply and Colose]ボタンでダイアログを閉じる

対応2 : 書き方を変える

以下のサイトを参考に書き方をちょっと変える。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?