I don't know if this is not permissible, but I thought I could embed any kind
of file as an attribute in a template.
For example, I have the following definitions:
<definition name="REGEXP:([^.]+)"
template="/WEB-INF/views/tiles/layouts/ace/default.jsp" preparer="testPreparer">
<put-attribute name="meta"
value="/WEB-INF/views/tiles/{options[defaultPaths]}/meta.jsp"/>
<put-attribute name="head"
value="/WEB-INF/views/tiles/{options[defaultPaths]}/head.jsp"/>
<put-attribute name="header"
value="/WEB-INF/views/tiles/{options[defaultPaths]}/header.jsp"/>
<put-attribute name="menu"
value="/WEB-INF/views/tiles/{options[defaultPaths]}/menu.jsp"/>
<put-attribute name="body"
value="/WEB-INF/views/tiles/{options[defaultPaths]}/body.jsp"/>
<put-attribute name="onReady"
value=".page.onReady//{options[defaultPaths]}" />
<put-list-attribute name="defaultPaths" cascade="true" >
<add-attribute value="{1}"/>
<add-attribute value="default"/>
</put-list-attribute>
</definition>
<definition name="REGEXP:^\.page\.onReady//(.+)"
template="/WEB-INF/views/tiles/layouts/ace/onReady.jsp">
<put-attribute name="onReady"
value="/WEB-INF/views/tiles/{1}/onReady.js" />
</definition>
I have the following files in my paths:
/WEB-INF/views/tiles/layouts/ace/default.jsp
/WEB-INF/views/tiles/layouts/ace/onReady.jsp
/WEB-INF/vies/tiles/default/head.jsp
/WEB-INF/vies/tiles/default/menu.jsp
/WEB-INF/vies/tiles/secure/login/meta.jsp
/WEB-INF/vies/tiles/secure/login/header.jsp
/WEB-INF/vies/tiles/secure/login/body.jsp
/WEB-INF/vies/tiles/secure/login/onReady.js
When I navigate to template: secure/login I am expecting the following:
WEB-INF/views/tiles/layouts/ace/default.jsp
-> /WEB-INF/vies/tiles/secure/login/meta.jsp
-> /WEB-INF/vies/tiles/default/head.jsp
-> /WEB-INF/vies/tiles/secure/login/header.jsp
-> /WEB-INF/vies/tiles/default/menu.jsp
-> /WEB-INF/vies/tiles/secure/login/body.jsp
-> /WEB-INF/views/tiles/layouts/ace/onReady.jsp
-> /WEB-INF/views/tiles/secure/login/onReady.js
However, the onReady.jsp included as an attribute in the default.jsp file is not properly rendered. If I change the name of onReady.js to
onReady.js.jsp, everthing works properly. If I leave the template attribute as onReady.js, then instead of getting my js files included (as I
expect), I get the entire default.jsp file embdeded as though it was the "onReady" attribute.
I think I have probably done a poor job of explaining this, so if something is unclear, please let me know. Is there no way to include a files
contents as is?
Thanks,
Eric