Page with nested layouts causes separate tag to execute in a page context without supplied attributes


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

First, when trying Stripes 1.5.4 (I first tried 1.5.8, then worked my way back to a working version in 1.5.3, then started forward one version at a time), we run into what appears to be an issue with pages that have nested layout renders and the way they handle page contexts. 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.

When the page is executed, the left hand menu tag gets executed several times. I suspect this is being executed roughly once per sub-sub-layout render in the title tag plus once for the page itself. In one of these invocations, the page context for the main page contains the necessary data (the "data" and "myProperty" variables in the attached simplified example) but in the others it does not and the main page thus passes null to the tag. The JavaBean isn't expecting nulls and an NPE results. If I remove the sub-sub-layout renders from the title tag (by replacing the content of the "dropMenus" layout component in TestActionBeanTitle.tag with static text), this does not occur.

While I can make the JavaBean threadsafe (the results of the invocations where the parameters are null seem to get thrown away from what I can tell, so returning nonsense "works"), I'm nervous about other c:if or c:choose logic also being impacted by unexpected and logically incorrect nulls. I suppose in theory there's also a potential concern about performance issues due to tags potentially being executed many more times than is necessary.

I know this does not occur in 1.5.3 and does in 1.5.4. I'm uncertain if it might be addressed in a later version, as I encounter a different issue with 1.5.5 through 1.5.8 with this sample page, even with the sub-sub-layout renders removed (I'll be opening a separate issue for that).

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.

Sample log with stripes debug turned on:


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)




Robert West



Affects versions