Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify difference between data-sly-include and data-sly-resource #64

Closed
tripodsan opened this issue Jun 25, 2018 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@tripodsan
Copy link
Contributor

the spec does not clearly state the difference between data-sly-include and data-sly-resource.

it would be nice to give an example.

@tripodsan
Copy link
Contributor Author

tripodsan commented Jun 27, 2018

when looking at the implementations of the extensions:

it looks like data-sly-resource creates a new internal request against the sling engine, where as data-sly-include looks for the specified script/servlet and executes it, using the same request context, i.e. the same current resource.

so data-sly-resource can be compared with a <jsp:include page="" /> and data-sly-include is similar to <%@ include file="" %>

@raducotescu correct?

@raducotescu
Copy link
Member

@tripodsan, that's the correct analogy and the specification does mention this:

data-sly-include:

  • Includes the output of a rendering script run with the current context.

data-sly-resource:

  • Includes a rendered resource.

@tripodsan
Copy link
Contributor Author

would be nice to update the specification. imo, only people familiar with sling might possibly understand the current description. I will provide a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants