You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Leonardo Uribe (JIRA)" <de...@myfaces.apache.org> on 2012/06/14 14:55:42 UTC

[jira] [Commented] (MYFACES-3383) Self nested Composite Component leads to EL Stack Overflow

    [ https://issues.apache.org/jira/browse/MYFACES-3383?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13295001#comment-13295001 ] 

Leonardo Uribe commented on MYFACES-3383:
-----------------------------------------

I have found a good solution for this issue, that passes all tests done. The idea is create a counter that identify the composite component nesting level and attach it to all created EL expressions, like we do with the Location object. This counter helps to identify the "context" where this EL expression belongs. If the counter is 0, the algorithm works as is working now, but if not, this info is taken into account when the algorithm try to found the composite component.

The hack works well in complex situations, but since the ccLevel is context dependant information and can change, the EL caching algorithm should change a little bit. I have not found any side effects, all junit tests done in that part works, even the ones using "findComponent expression" hack, used to resolve the library name h:outputScript or h:outputStylesheet expressions.

I also tried the example provided and it works. It took me a lot of time to understand and solve this one fully.

If no objections I'll commit the proposed solution soon.
                
> Self nested Composite Component leads to EL Stack Overflow
> ----------------------------------------------------------
>
>                 Key: MYFACES-3383
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3383
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.1.2
>         Environment: Windows
>            Reporter: Michael Dietrich
>         Attachments: MYFACES-3383-1.patch, TestStackOverflow.war
>
>
> If the same Composite Component is used inside itself, e.g. as child of an ui:include that is included in the Composite Component, an StackOverflow happens, if an EL Expression is refering CC interface attributes. 
> The use case is a CC to include a facelet, given by name. If the included facelet uses the same CC to include another facelet, "CompositeComponentELUtils.getCompositeComponentBasedOnLocation(..)"  does always find the same CC, which leads to an endless loop.
> Please see the attached file for an example of the issue.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira