> i want to include a script using a specific resource type, eg: > > <sling:include path="<%= child.getPath %>" > resourceType="/apps/myapp/test/nav" /> > > if the resource exists, the include tag handler does not create a > syntetic one and it uses the resource type of the resource. > if i create a syntic resource myself: > > <% SyntheticResource res = new SyntheticResource(child.getPath(), > "/apps/myapp/test/nav"); %> > <sling:include resource="<%= res %>"/> > > this results in a NPE: > > Caused by: java.lang.NullPointerException > at > org.apache.sling.usling.renderers.DefaultHtmlRenderer.render(DefaultHtmlRenderer.java:53) > at > org.apache.sling.usling.renderers.DefaultHtmlRendererServlet.doGet(DefaultHtmlRendererServlet.java:72) > at > org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:261) > > so my question is: how can i include a resource using a specific resource > type?
found the solution myself: i need to specify the resource type relative: <% SyntheticResource res = new SyntheticResource(child.getPath(), "myapp/test/nav"); %> however, i think the include tag should to the exact same, then a path and an explicit resource type is specified. regards, toby -- -----------------------------------------< [EMAIL PROTECTED] >--- Tobias Bocanegra, Day Management AG, Barfuesserplatz 6, CH - 4001 Basel T +41 61 226 98 98, F +41 61 226 98 97 -----------------------------------------------< http://www.day.com >---
