Skip navigation

CQ5

JohnMMathews
Currently Being Moderated

Sling Not Resolving "init.jsp"

Jun 19, 2012 6:27 PM

Tags: #sling #cq5.4

Not a big deal, just wondering why init.jsp has to be included absolutely and it can't be located via sling's normal script resolution like headlibs.jsp?

 

<cq:include script="headlibs.jsp" />

 

<cq:include script="/libs/wcm/core/components/init/init.jsp" />

 

I have tried adding all variations of paths to the Resource Search configuration and no dice.  I noticed it is also included absolutely here "/libs/foundation/components/page/head.jsp".  Is there a reason for this?

 

Thanks,
John

 
Replies
  • Currently Being Moderated
    Jun 20, 2012 5:58 AM   in reply to JohnMMathews

    Including a script and including a component (via resourceType) are a little different.  You always have to include a script by relative location.  This inclusion will work its way up the resourceSuperType tree of the component including it, until it finds a script at that location.  When you include a component, you don't specify a "location", you specify a resource type.  That's the big difference.

     

    The reason you probably cannot include init.jsp without the full path is that whatever component in which that this script resides, does not extend (via resource type) the "init" component in which that script resides.  You could also POSSIBLY replace you include of that script with <cq:include path="init" resourceType="wcm/core/components/init" /> if you really have a problem with the full path location.  That might work for you as an alternative.  Though, I can't promise it'll work, because I can't remember what that init component/script do.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points