joelt
joelt

Reputation: 2680

Default script resolutions in Sling

I don't know that I have the terminology completely correct, but it seems that there are some default behaviors for script resolution in Sling (which I'm using as part of Day CQ). For example, .infinity.json returns a representation of the node and its children. Also, if I have a piece of content that I normally would access with a .html extension, I've been able to use a .xml or .json extension to get a representation of that data. However, if I use a .txt extension, I get nothing back, even though as far as I can tell, I do have scripts that should match the request (eg GET.jsp). Are these behaviors documented somewhere?

Upvotes: 0

Views: 712

Answers (1)

Bertrand Delacretaz
Bertrand Delacretaz

Reputation: 6100

GET.jsp will match a request ending with .html, as Sling considers html as the default representation. To activate a JSP script for the .txt rendering, you need to name it txt.jsp

See http://sling.apache.org/site/servlets.html for details.

Upvotes: 1

Related Questions