0

I have got a xhtml page and there are some labels on it. I am trying to do some labels to be visible according to combobox item selection. These values are at a .txt file. My xhtml is like this:

<h:outputText rendered="#{myBean.student == '#{properties.grade}'}" value="100"/>

But I got Syntax error in EL at my xhtml. How can I render a value from properties.txt file?

xxxx
  • 27
  • 2
  • 8
  • did you Update faces-config.xml ? – Taha Jun 13 '16 at 11:27
  • Why do I need that? I just could not express the exact syntax I think. – xxxx Jun 13 '16 at 11:31
  • No you should update it – Taha Jun 13 '16 at 11:32
  • also to call a property in a properties file you should use this syntax : #{Var_Declared_In_FACESCONFIG.xml['property']} – Taha Jun 13 '16 at 11:33
  • What kind of update do I need? – xxxx Jun 13 '16 at 11:34
  • take a look at this tutorial http://www.tutorialspoint.com/jsf/jsf_internationalization.htm – Taha Jun 13 '16 at 11:34
  • ---Location of properties file --- ---Name of variable used to call this file --- – Taha Jun 13 '16 at 11:35
  • I have already getting labels from properties file and I did not do any update at facesconfig.xml. I need exact syntax of my problem I think. – xxxx Jun 13 '16 at 11:38
  • `#{myBean.student == properties.grade}` should do it. – Holger Jun 13 '16 at 12:58
  • You need to explicitly state what the error is. And then search for that error. Btw, @holger is right. And there is a duplicate of this. Nesting EL expressions – Kukeltje Jun 13 '16 at 22:41
  • it is not the exact duplicate. I am trying to read the render value from .properties.txt file. I need syntax of inside to inside # usage. – xxxx Jun 14 '16 at 05:59
  • The fact that you put EL inside quote is wrong. JSF understands that as a string and not an EL. The best solution would be to implement a method in your Controller, write your logic there and call it from the XHTML. By this you would decouple the UI from tha backend. – Shady Hussein Jun 14 '16 at 09:20

0 Answers0