Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This article shows how you can use include in jsp. to To use include in jsp and access Sling variables there are two tags available in Sling. If you want to use Sling variables in your script the <sling:defineObjects/> tag should be used.

If you want to use Sling's include feature the you have to give the parameters in the <sling:include .. /> tag.

Before using these tags you have to import the tag library with

<%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling/1.0"%>

...

Using path with resourceType to include a script.

Using resource with resourceType to include a script.

Include sample in Discover Sling in 15 minutes using  <sling:include .../> jsp tag.

sling.include can be called in two ways in a JSP script.

...