cannot set dynamic value for Locale attribute to f:view
-------------------------------------------------------
Key: MYFACES-1715
URL: https://issues.apache.org/jira/browse/MYFACES-1715
Project: MyFaces Core
Issue Type: Bug
Affects Versions: 1.2.0
Environment: MyFaces 1.2.0
Trinidad 1.2.1
Facelets 1.1.11
JDK 1.5.0_12
Tomcat 6.0
Windows XP Service Pack 2
Reporter: Eric Lewandowski
Priority: Minor
My application displays pages generated by Apache Trinidad, MyFaces and by SUN
facelets. Xhtml pages are tiled with Facelets
I follow the instructions on Trinidad wiki to use it with faceletes
I have a backend Bean called languageManager which store the locale (string
value) selected by user and I want to propagate this locale to all faces pages.
I used the attribute locale of <f:view> tag to do this
<f:view locale="#{languageManager.locale}">
When MyFaces generates the page, I have :
com.sun.facelets.tag.TagAttributeException:
/WEB-INF/template/one-col-template.xhtml @9,45
locale="#{languageManager.locale}" Attribute did not evaluate to a String or
Locale: null
at
com.sun.facelets.tag.jsf.ComponentSupport.getLocale(ComponentSupport.java:164)
at com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:83)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:119)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:248)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:294)
at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
at
com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:143)
at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:510)
at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:553)
at
javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:45)
at
org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:174)
I debug the code and I found that my backend bean is created (constructor is
called) but the method public String getLocale() of my bean is never called
so a null value is returned during locale evaluation.
I downgraded my third-parties version from MyFaces 1.2.0 to MyFaces 1.1.5 and
Trinidad 1.2.1 to 1.0.2 and this solve the problem without any other
modifications.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.