How to compare an EL expression against the result of another EL expression

后端 未结 1 692
离开以前
离开以前 2020-12-12 05:08

I have following attribute in my Facelet:

rendered=\"#{createTicketBaseBean.show == \'#{I18N[\'key_please_select\']}\'}\"

I am trying to co

1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-12 05:50

    This is indeed invalid syntax. You can't and shouldn't nest EL expressions. You should see the #{} as one whole scope where variables can interact with each other.

    Given your desired comparison

    createTicketBaseBean.show == I18N['key_please_select']
    

    this is the proper syntax:

    rendered="#{createTicketBaseBean.show == I18N['key_please_select']}"
    

    0 讨论(0)
提交回复
热议问题