Fix EL stack overflow when including templates with a relative path on theme
views
----------------------------------------------------------------------------------
Key: NXP-6612
URL: https://jira.nuxeo.com/browse/NXP-6612
Project: Nuxeo Enterprise Platform
Issue Type: Bug
Components: Themes
Affects Versions: 5.4.1
Reporter: Anahide Tchertchian
Fix For: 5.4.x
Steps to reproduce:
- declare a theme view with a xhtml template, for instance in old JSF dashboard
(now located in addon nuxeo-platform-user-dashboard-compat):
<view name="nuxeo5 user workspaces" template-engine="jsf-facelets">
<!-- Fragment to be displayed as part of the dashboard to display the
list of tasks of workspaces the current user can see -->
<format-type>widget</format-type>
<template>dashboardcompat/incl/dashboard_user_workspaces.xhtml</template>
<resource>foldable-box.js</resource>
</view>
- make this template use an include with a relative path, for instance:
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:nxu="http://nuxeo.org/nxweb/util">
<nxu:methodResult name="provider"
value="#{resultsProvidersCache.get('USER_WORKSPACES')}">
<ui:decorate template="foldable_box_document_listing.xhtml">
<ui:param name="documents" value="#{provider.currentPage}" />
<ui:param name="provider" value="#{provider}" />
<ui:param name="heading"
value="#{messages['title.dashboard.userWorkspaces']}" />
<ui:param name="idParam" value="USER_WORKSPACES" />
</ui:decorate>
</nxu:methodResult>
</div>
instead of:
<div xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:nxu="http://nuxeo.org/nxweb/util">
<nxu:methodResult name="provider"
value="#{resultsProvidersCache.get('USER_WORKSPACES')}">
<ui:decorate
template="/dashboardcompat/incl/foldable_box_document_listing.xhtml">
<ui:param name="documents" value="#{provider.currentPage}" />
<ui:param name="provider" value="#{provider}" />
<ui:param name="heading"
value="#{messages['title.dashboard.userWorkspaces']}" />
<ui:param name="idParam" value="USER_WORKSPACES" />
</ui:decorate>
</nxu:methodResult>
</div>
=> the view is not rendered (request lags for a long time) and ends up with a
stack overflow error (but the actual variable where error occurs is not
significant):
2011-03-30 19:06:41,300 ERROR [facelets.viewhandler] Error Rendering
View[/dashboardcompat/user_dashboard.xhtml]
com.sun.facelets.tag.TagAttributeException:
//default/*/jsf-facelets/userDashboardCompat/user_dashboard/foldable_box_document_listing.xhtml
@74,44 value="#{m
essages[action.label]}" Could not Resolve Variable [Overflow]: messages
at
com.sun.facelets.tag.TagAttribute.getValueExpression(TagAttribute.java:259)
at
com.sun.facelets.tag.jsf.ComponentRule$ValueExpressionMetadata.applyMetadata(ComponentRule.java:69)
at com.sun.facelets.tag.MetadataImpl.applyMetadata(MetadataImpl.java:36)
at
com.sun.facelets.tag.MetaTagHandler.setAttributes(MetaTagHandler.java:62)
...
Caused by: javax.el.ELException: Could not Resolve Variable [Overflow]: messages
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:64)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:60)
...
Caused by: java.lang.StackOverflowError
at java.lang.Exception.<init>(Exception.java:59)
at java.lang.RuntimeException.<init>(RuntimeException.java:61)
at javax.el.ELException.<init>(ELException.java:54)
at
com.sun.facelets.el.VariableMapperWrapper.resolveVariable(VariableMapperWrapper.java:64)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.nuxeo.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets