JSF2 ResourceBundleLoader override?

Posted by CDSO1 on Stack Overflow See other posts from Stack Overflow or by CDSO1
Published on 2010-04-29T21:28:53Z Indexed on 2010/04/29 21:37 UTC
Read the original article Hit count: 603

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about jsf2

Related posts about el