[
https://issues.apache.org/jira/browse/MYFACES-3246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Leonardo Uribe resolved MYFACES-3246.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.1.2
2.0.8
Assignee: Leonardo Uribe
Thanks for the example. It helps a lot to create a JUnit test using the
wonderful FaceletTestCase base class and fix this one quickly. Just create the
files, add some lines of code and that's it!.
The problem is related to FaceletContext.FACELET_CONTEXT_KEY. This key by
historical reasons is assigned on the constructor of DefaultFaceletContext, but
this is not good, because in some cases like ui:include, we should revert to
the previous context as soon as the tag has been applied. So, this key should
be put and restored on the places where a DefaultFaceletContext is created.
AjaxHandler.applyAttachedObject retrieve a FaceletContext instance from this
key, so if you move the button before ui:include it will work.
> java.lang.IndexOutOfBoundsException when CACHE_EL=always
> ---------------------------------------------------------
>
> Key: MYFACES-3246
> URL: https://issues.apache.org/jira/browse/MYFACES-3246
> Project: MyFaces Core
> Issue Type: Bug
> Environment: myfaces core trunk
> Reporter: Martin Kočí
> Assignee: Leonardo Uribe
> Fix For: 2.0.8, 2.1.2
>
>
> java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
> at java.util.ArrayList.RangeCheck(ArrayList.java:547)
> at java.util.ArrayList.get(ArrayList.java:322)
> at
> org.apache.myfaces.view.facelets.impl.DefaultFaceletContext.getTemplateContext(DefaultFaceletContext.java:632)
> at
> org.apache.myfaces.view.facelets.impl.DefaultFaceletContext.isAllowCacheELExpressions(DefaultFaceletContext.java:831)
> at
> org.apache.myfaces.view.facelets.tag.TagAttributeImpl.getValueExpression(TagAttributeImpl.java:426)
> at
> org.apache.myfaces.view.facelets.tag.jsf.core.AjaxHandler.applyAttachedObject(AjaxHandler.java:391)
> at
> org.apache.myfaces.view.facelets.tag.jsf.core.AjaxHandler.apply(AjaxHandler.java:218)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira