How to compare 2 strings with ?

后端 未结 1 1892
情话喂你
情话喂你 2021-02-09 17:06

I am trying to display a or accordingly to a String property returned by a backing bean. I am having problem

1条回答
  •  孤独总比滥情好
    2021-02-09 17:17

    You seem to be using this in a . The JSTL tags are evaluated during view build time only, not during view render time. It boils down to this: JSTL runs from top to bottom first and then hands the produced result over to JSF to run from top to bottom again. At the moment the JSTL tags are evaluated inside a JSF datatable, the datatable's iterated item (the one in var attribute) isn't available to JSTL. Hence the test result is always false.

    Just use JSF component's rendered attribute instead.

    
    
    

    Here are some more examples how you could utilize the rendered attribute:

    
    
    
    
    
    
    
    

    Unrelated to the concrete problem, Roseindia is not the best JSF learning resource. I'd recommend to head to other resources.

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