JSF2 ResourceBundleLoader override?
- by CDSO1
I need to have resource messages that contain EL expressions be resolved when loaded from a ResourceBundle. Basically I have a number of properties files containing the text. Some of the text will look like the following:
welcomeText=Welcome #{userbean.name}
The only possible way I can see this working currently is implementing a custom taglib so that instead of saying:
<f:loadBundle var="messages" basename="application.messages"/>
I would have to use
<mytaglib:loadBundle var="messages" basename="application.messages"/>
#{messages.welcomeText}
Given a user with username "User1", this should output
Welcome User1
My implementation would then use a custom ResourceBundle class that would override handleGetObject, use the ELResolver to resolve variables etc....Ideas? suggestings? Implementations that are already available?
I appreciate your assistance.