Uploaded image for project: 'Stripes'
  1. STS-924

Nested layout renders resulting in infinite recursion

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Won't Fix
    • Affects Version/s: Release 1.5.5, Release 1.5.6, Release 1.5.7, Release 1.5.8
    • Fix Version/s: Release 1.6
    • Component/s: None
    • Labels:
      None
    • Environment:
      JBoss 5.1.0* (we have a few local modifications we use)
      tomcat 8.0.12 (with jstl 1.2 added to the lib directory)
      Running on Mac OS X (10.9.4)
    • Sprint:

      Description

      We are currently running on an older version of stripes (either 1.5.0 or 1.5.1 with the patch for STS-655 Closed applied) and are looking to upgrade, but have run into a couple of what appear to be bugs.

      When trying Stripes 1.5.8, we ran into an issue where our page seems to result in an infinite loop when it hits a nested layout-render tag. This same stack pattern seems to occur in all versions from 1.5.5 through 1.5.8. Our standard layout definition for displaying most entities in the system uses jsp:includes to grab various standard navigational elements and then uses two tags to provide a title bar and a left hand menu to wrap around the basic body component implemented by whatever page is using the layout.

      The left hand menu tag takes a couple of parameters and supplies them to a JavaBean created via jsp:useBean. The title tag takes some of the same data but then uses nested layout renders to render the various drop-down menus in the title bar. One layout render is used to generate the entire drop-down menu and then further nested layouts are used to render each button on the drop-down menu. However, in this case the infinite recursion seems to occur even if I remove the further nested layouts (resulting in one layout-render that invokes one layout-render for two total).

      When the page is executed, the first part of the page seems to proceed normally exactly as it does in 1.5.4. Once it hits the nested layout render, it does the layout init and then invokes the component renderer for the title component. In 1.5.4, it then eventually starts the component render phase and proceeds from there. In 1.5.8 however, it seems to reset to where it pushed the context and then starts the test-title-box processing from the beginning again. There are 1.5.4 and 1.5.8 log snippets below for the same application.

      I've tried this in our current JBoss 5.1.0 environment we use in production and also in a vanilla tomcat 8.0.12 installation (my only modification was to include the jstl 1.2 library in the tomcat lib directory). The behavior seems to be the same in either case.

      Happy to try other ideas and help with the investigation. I tried working through the various Stripes tags and page context manipulation to try and figure out what might be going on, but my brain kept getting tied up in knots. :-D

      1.5.4 execution of the page with Stripes debug logging turned on:

      2014-09-11 09:24:23,560 INFO  localhost-startStop-1 [StripesFilter] Stripes Initialization Complete. Version: 1.5.4, Build: 1.5.4
      2014-09-11 09:24:33,927 DEBUG http-nio-8080-exec-1 [StripesFilter] LocalePicker selected locale: en_US
      2014-09-11 09:24:33,927 DEBUG http-nio-8080-exec-1 [StripesFilter] LocalePicker did not pick a character encoding, using default: null
      2014-09-11 09:24:33,929 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] Matched /testing/Test.action to /testing/Test.action
      2014-09-11 09:24:33,939 INFO  http-nio-8080-exec-1 [ExpressionValidator] Expression validation will be performed using: net.sourceforge.stripes.validation.expression.Jsp21ExpressionExecutor
      2014-09-11 09:24:33,941 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage RequestInit
      2014-09-11 09:24:33,942 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage ActionBeanResolution
      2014-09-11 09:24:33,943 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] Matched /testing/Test.action to /testing/Test.action
      2014-09-11 09:24:33,943 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] Matched /testing/Test.action to /testing/Test.action
      2014-09-11 09:24:33,948 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage HandlerResolution
      2014-09-11 09:24:33,948 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] Matched /testing/Test.action to /testing/Test.action
      2014-09-11 09:24:33,948 DEBUG http-nio-8080-exec-1 [DispatcherHelper] Resolved event: defaultResolution; will invoke: TestActionBean.defaultResolution()
      2014-09-11 09:24:33,949 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage BindingAndValidation
      2014-09-11 09:24:33,953 DEBUG http-nio-8080-exec-1 [DefaultValidationMetadataProvider] Loaded validations for ActionBean TestActionBean: <none>
      2014-09-11 09:24:33,953 DEBUG http-nio-8080-exec-1 [DefaultActionBeanPropertyBinder] Running required field validation on bean class com.backstopsolutions.stripes.TestActionBean
      2014-09-11 09:24:33,954 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage CustomValidation
      2014-09-11 09:24:33,956 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage EventHandling
      2014-09-11 09:24:33,958 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage ResolutionExecution
      2014-09-11 09:24:33,958 DEBUG http-nio-8080-exec-1 [HttpCacheInterceptor] Looking for HttpCache on com.backstopsolutions.stripes.TestActionBean.defaultResolution()
      2014-09-11 09:24:33,960 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] No URL binding matches /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:33,960 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] No URL binding matches /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,489 DEBUG http-nio-8080-exec-1 [LayoutContext] Push context /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,489 DEBUG http-nio-8080-exec-1 [LayoutWriter] Create layout writer wrapped around org.apache.jasper.runtime.JspWriterImpl@68662676
      2014-09-11 09:24:34,490 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start layout init in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,490 DEBUG http-nio-8080-exec-1 [LayoutWriter] Failed to flush buffer: Illegal to flush within a custom tag
      2014-09-11 09:24:34,491 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Register component embeddedStyle with /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,492 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Register component embeddedJavascript with /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,492 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Register component body with /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,493 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End layout init in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,493 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start layout exec in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Invoke component renderer for direct render of "embeddedStyle"
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Render component "embeddedStyle" in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Start execute "embeddedStyle" in /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp from /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start component render phase for embeddedStyle in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Render embeddedStyle in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedJavascript in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for body in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End component render phase for null in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,883 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] End execute "embeddedStyle" in /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp from /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,884 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Invoke component renderer for direct render of "embeddedHead"
      2014-09-11 09:24:34,884 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No component renderer in page context for 'embeddedHead'
      2014-09-11 09:24:34,884 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Component was not present in /WEB-INF/stripes/testAction.jsp so using default content from /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,886 DEBUG http-nio-8080-exec-1 [LayoutContext] Push context /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp
      2014-09-11 09:24:34,886 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start layout init in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,886 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Register component title with /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,886 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Register component dropMenus with /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,886 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End layout init in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,886 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start layout exec in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Invoke component renderer for direct render of "title"
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Render component "title" in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Start execute "title" in /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp from /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedStyle in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedHead in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start component render phase for title in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,962 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Render title in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,966 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] Matched /testing/Test.action to /testing/Test.action
      2014-09-11 09:24:34,966 DEBUG http-nio-8080-exec-1 [UrlBindingFactory] Matched /testing/Test.action to /testing/Test.action
      2014-09-11 09:24:34,966 DEBUG http-nio-8080-exec-1 [DefaultFormatterFactory] Caching Formatter for class java.lang.String => class net.sourceforge.stripes.format.ObjectFormatter
      2014-09-11 09:24:34,967 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for dropMenus in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,967 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End component render phase for null in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,968 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for body in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,971 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedJavascript in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,972 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] End execute "title" in /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp from /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp
      2014-09-11 09:24:34,972 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Invoke component renderer for direct render of "dropMenus"
      2014-09-11 09:24:34,972 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Render component "dropMenus" in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,972 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Start execute "dropMenus" in /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp from /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp
      2014-09-11 09:24:34,972 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedStyle in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,972 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedHead in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start component render phase for dropMenus in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for title in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Render dropMenus in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End component render phase for null in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for body in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedJavascript in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,973 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] End execute "dropMenus" in /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp from /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End layout exec in /layouts/test-title-box.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutContext] Pop context /layouts/testActionBeanLayout.jsp -> /layouts/test-title-box.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Invoke component renderer for direct render of "body"
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Render component "body" in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Start execute "body" in /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp from /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start component render phase for body in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedStyle in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedJavascript in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,974 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Render body in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,975 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End component render phase for null in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,975 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] End execute "body" in /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp from /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Invoke component renderer for direct render of "embeddedJavascript"
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Render component "embeddedJavascript" in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] Start execute "embeddedJavascript" in /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp from /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] Start component render phase for embeddedJavascript in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for embeddedStyle in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] Render embeddedJavascript in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentTag] No-op for body in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End component render phase for null in /WEB-INF/stripes/testAction.jsp
      2014-09-11 09:24:34,976 DEBUG http-nio-8080-exec-1 [LayoutComponentRenderer] End execute "embeddedJavascript" in /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp from /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,977 DEBUG http-nio-8080-exec-1 [LayoutRenderTag] End layout exec in /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,977 DEBUG http-nio-8080-exec-1 [LayoutContext] Pop context /WEB-INF/stripes/testAction.jsp -> /layouts/testActionBeanLayout.jsp
      2014-09-11 09:24:34,977 DEBUG http-nio-8080-exec-1 [LayoutWriter] Failed to flush buffer: Illegal to flush within a custom tag
      2014-09-11 09:24:34,978 DEBUG http-nio-8080-exec-1 [ExecutionContext] Transitioning to lifecycle stage RequestComplete
      

      1.5.8 execution of the page with Stripes debug logging turned on attached compressed.

        Attachments

          Activity

            People

            • Assignee:
              rgrashel Rick Grashel
              Reporter:
              rwest Robert West
            • Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: