| Author |
Kick off localization in JSF
|
Russell Bateman
Ranch Hand
Joined: Feb 26, 2008
Posts: 66
|
|
In my .jsp, I've got:
...and running the file I see
Caused by:
org.apache.jasper.el.JspPropertyNotFoundException - /login.jsp(22,8) '#{msg.catalog.title}' Property 'title' not found on type java.lang.String
Of course, I've got a file on the (Eclipse) path src/com/mydomain/catalog/messages.properties (as well as one in French). I also tried messages_en.properties (and using "messages_en" in place of "messages" in loadBundle), but to no avail. In those message files I've got:
In faces-config.xml I have:
Would someone explain the conceptual link between having messages, having an <application> tag in faces-config.xml and doing a loadBundle in the JSP? I'd like to figure this out, but so far, neither Google nor experimenting has helped. Or a link to someplace that explains.
Profuse thanks in advance,
Russ Bateman
|
 |
Tim Holloway
Saloon Keeper
Joined: Jun 25, 2001
Posts: 12513
|
|
"#{msg.catalog.title}" is EL for "msg.getCatalog().getTitle()". Not what you want.
Without doing anything as intelligent as actually checking, I believe that the proper syntax is: "#{msg['catalog.title']}, since I'm pretty sure that "msg" is a map, and that's how you lookup map keys in EL.
|
One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
|
 |
Russell Bateman
Ranch Hand
Joined: Feb 26, 2008
Posts: 66
|
|
Thank you very much. I had seen that construct here and there while Googling, but not understood what it was specifically for. One article in particular misled me into the syntax I chose. It seemed reasonable and I moved on puzzled as to why it wasn't working. I'm not certain how long it would have been before it dawned on me, so I thank you very much for this.
Russ
|
 |
 |
|
|
subject: Kick off localization in JSF
|
|
|