i guess this should work via @Named("myMessageBean") on the interface.
I think that at startup a cdi bean is created form the interface, but I am not
sure.
Mit freundlichen Grüßen
Thomas Herzog
Softwareentwicklung
curecomp Software Services GmbH
Hafenstrasse 47-51
4020 Linz
web: www.curecomp.com
e-Mail: [email protected]
tel: +43 (0)732 9015-5563
mobile: +43 (0)664 8867 9829
-----Ursprüngliche Nachricht-----
Von: Martijn Hiemstra [mailto:[email protected]]
Gesendet: Freitag, 05. Juli 2013 15:27
An: [email protected]
Betreff: Access Resourcebundles from xhtml
I have a question about deltaspike. I want to remove all calls to <f:loadBundle
/> in my xhtml pages.
I have defined a message resolver and I have defined a MessageBundle interface
called MyMessageBundle and added the @MessageBundle annotation.
This works great when calling MyMessageBundle from a managedbean using
injection however how can I access the resource bundle from a xhtml page?
Can I give MyResourceBundle a name so that in my xhtml file I can say
#{myResourceBundle.getUserFirstNameLabel}
It would be nice if with deltaspike all hardcoded references to resourcebundle
are removed from faces-config.xml and when you add a new resource bundle all
you need to do is add a new resourcebundle interface and then you can use that
resource bundle in your xhtml file.
For example:
@ResourceBundle("lang")
MyResourceBundle
And in the xhtml like this:
<h:outputText value="#{lang.getUserFirstNameLabel]}" />
Met vriendelijke groet,
Martijn Hiemstra
Java Software Engineer
Regas B.V.
Pelmolenlaan 18a
3447 GW Woerden