mojarra icon indicating copy to clipboard operation
mojarra copied to clipboard

Resource bundle always null

Open hrsto opened this issue 6 years ago • 2 comments

https://github.com/javaserverfaces/mojarra/blob/bbac72aabda02f7e605d05f71da0be2fd0814ce7/impl/src/main/java/javax/faces/component/UIComponent.java#L2688

EE8, JSF 2.3, on Wildfly 15.

From a custom renderer of a custom component, this code:

@Override
public void encodeEnd(FacesContext ctx, UIComponent comp) throws IOException {
     SomeComp c = (SomeComp) comp;

     java.util.ResourceBundle.getBundle(c.getClass().getName(), java.util.Locale.getDefault());

I would get a valid resource bundle with the expected keys and values, as i've set it up.

But if i call c.getResourceBundleMap(); - it will always returns an EMPTY_MAP. Tracked it to the line 2688 of UIComponent.java where i can confirm that className exactly matches the class name of my component, as expected, but still it would return null.

In other words, from my class, the exact same call with the same parameters returns the expected resource bundle, but UIComponent#getResourceBundleMap doesn't. As a work around, i'd overwrite it, i guess.

hrsto avatar Feb 10 '19 19:02 hrsto

mojarra issue tracker moved to: https://github.com/eclipse-ee4j/mojarra

erickdeoliveiraleal avatar Feb 19 '19 17:02 erickdeoliveiraleal

Thanks!

Sent from my Apple Watch

On Feb 19, 2019, at 14:20, Erick de Oliveira Leal [email protected] wrote:

mojarra issue tracker moved to: https://github.com/eclipse-ee4j/mojarra

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

rodrigo-troy avatar Feb 19 '19 17:02 rodrigo-troy