Hi,

On Thu, Jun 17, 2010 at 3:51 PM, Federico Paparoni
<[email protected]> wrote:
> ...If I use the url http://localhost:8080/content/david.list (calling it on 
> the
> root node :P) I receive the plain text...

That's not calling it on the root node, root node would be
http://localhost:8080/

What happens here is that Sling selects the /content/david node as the
current resource, looks at its sling:resourceType property (if there's
one), and finds a script or servlet to render that resource type with
the "list" extension.

You should be able to follow that process using the "recent requests"
plugin at /system/console, Sling should show there what the resource
type is, and which script it selects to process the request.

I'm not sure why this doesn't use your script at /apps/david/list.esp,
what's the sling:resourceType of that node?

>. If I append the .html suffix  so I
> call http://localhost:8080/content/david.list.html I run the script. I have
> this behaviour only for this script....

That request selects the same node, but with a "list" selector and
"html" extension. If your resource type is "david" that should use the
script at /apps/david/html.esp, or /apps/david/list.esp if that
exists. The latter takes precedence as it's more specific.

Here's an example that works for me:

# create content node
curl -F sling:resourceType=david http://admin:ad...@localhost:8888/content/david
curl http://admin:ad...@localhost:8888/content/david.tidy.json (to
check content)

# upload script to render it
echo "Hello this is list.esp" > /tmp/list.esp
# this fails if /apps exists, fine
curl -X MKCOL http://admin:ad...@localhost:8888/apps
curl -X MKCOL http://admin:ad...@localhost:8888/apps/david
curl -T /tmp/list.esp http://admin:ad...@localhost:8888/apps/david/list.esp

# render node
# this  says "Hello this is list.esp"
curl http://admin:ad...@localhost:8888/content/david.list
# this also says "Hello this is list.esp"
curl http://admin:ad...@localhost:8888/content/david.list.html

# Now demonstrate html.esp vs. list.esp
echo "Now this is html.esp" > /tmp/html.esp
curl -T /tmp/html.esp http://admin:ad...@localhost:8888/apps/david/html.esp
# This says "Now this is html.esp"
curl http://admin:ad...@localhost:8888/content/david.html
# This says "Hello this is list.esp"
curl http://admin:ad...@localhost:8888/content/david.list.html

You could try that (on a fresh repository maybe) and see what's
different in your case.

-Bertrand

Reply via email to