> I am using the following code to embed the jsp file name, when admin > user is logged in it replace ROLE_ADMIN with the @com.... expression > but does not load menuRole_Admin.jsp page. It just shows > menuRole_Admin.jsp as a string on browser. > > > > <put-attribute name="menu" expression="OGNL: 'menu' + > > @com.myproject.controller.Default@getRole() + '.jsp'"/>
CompleteAutoloadTilesContainerFactory (which is loaded when CompleteAutoloadListener is used) takes its default attribute renderer from BasicTilesContainerFactory. This attempts to render any attribute first as a definition, then as a template, and lastly as a string. see BasicTilesContainerFactory.createDefaultAttributeRenderer(..) The template attribute renderer (DispatchRenderer) is failing you here. see BasicTilesContainerFactory.createTemplateAttributeRenderer(..) Mostly likely because the result of the ognl expression does not start with '/'. see DispatchRenderer.isRenderable(..) try putting the slash in front like… <put-attribute name="menu" expression="OGNL: '/menu' + @com.myproject.controller.Default@getRole() + '.jsp'"/> ~mck -- “If you have built castles in the air, your work need not be lost; that is where they should be. Now put the foundations under them.” - Henry David Thoreau | http://github.com/finn-no | http://tech.finn.no |
