-
1. Re: Can't read properties file on Seam page
jamesjmp Aug 18, 2009 4:14 PM (in response to oneworld95)I think the problem is the dot.
Replace person.name with person_name, so it would be:
`person_name=Jane Smith`
and then:
`<h:outputText value="#{forms.person_name}" />`
If you want to keep on using the dot maybe the syntax used for
messages bundle would work, so in that case try this:
'
#{forms['person.name']}
' -
2. Re: Can't read properties file on Seam page
oneworld95 Aug 18, 2009 4:20 PM (in response to oneworld95)Thanks, Jaime. The last example you gave works. But I'm curious, why does the second dot confuse it? I've searched on this error and couldn't find an explanation as to why it gives that particular java.lang.String exception. Thank you :)
-
3. Re: Can't read properties file on Seam page
jamesjmp Aug 18, 2009 4:41 PM (in response to oneworld95)It´s due to a limitation of the EL with bundle processing.
If you only use a dot, it considers what is after the dot to be the name of the property, and it would return a String with the value of that property. In your case this String is Jane Smith.
On the other hand, if you use 2 dots it considers what is after the second dot to be a property of the previous object, so it is trying to find aname
property in Jane Smith, which is a String. That´s why the error message displayed although weird is correct.
To avoid this EL wrong behaviour with dots you have to use the syntax I said before.#{forms['person.name']}
This way person.name is considered as a unit for the EL and is passed as a parameter to search that unit inside the properties file. And that´s all!
-
4. Re: Can't read properties file on Seam page
oneworld95 Aug 18, 2009 4:44 PM (in response to oneworld95)Thanks, Jaime. I thought I was losing my mind when trying to make the two dots work, but your explanation makes it all very clear :)
Thank you again.