Use single quote or double quote for strings in EL

Use single quote or double quote for strings in EL


    
        #{status.index}
        #{hero.id}
        #{hero.race}
        #{hero.name}
    


I wonder whether the usage of class="#{status.even ? 'evenColumn' : 'oddColumn'}" is correct. 
I feel a bit guilty of using single quotes instead of double quotes. But in this case, double quote fails, single quote wins.

Solutions/Answers:

Answer 1:

It’s perfectly fine. It’s also the convention I use: single quotes for strings in EL. It’s not only better readable, but it’s also friendly for syntax highlighting.

Using double quotes is valid, but harder to interpret when nested in a HTML attribute which is by itself also double quoted.

References