Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

java - Problems with Discover Sling in 15 minutes

I have problems with creating a content node with cURL. I execute the following command:

curl -u admin:admin -F"sling:resourceType=foo/bar" -F"title=some title" http://localhost:8080/content/mynode

But I can't see http://localhost:8080/content/mynode.html as there is showed the following problem:

Resource dumped by HtmlRendererServlet

Resource path: /content/mynode
Resource metadata: {sling.resolutionPathInfo=.html, sling.resolutionPath=/content/mynode}
Resource type: foo/bar
Resource super type: -

Resource properties

title: some title
sling:resourceType: foo/bar
jcr:createdBy: admin
jcr:created: 

http://localhost:8080/content/mynode.json has following content:

{"title":"some title","sling:resourceType":"foo/bar","jcr:createdBy":"admin","jcr:created":"Thu Jul 04 2013 21:24:36 GMT+0300","jcr:primaryType":"sling:Folder"}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The html output that you get is correct, it's the default Sling HTML rendering.

You probably haven't executed the "Render your content using server-side javascript (ESP)" steps at http://sling.apache.org/documentation/getting-started/discover-sling-in-15-minutes.html which will setup a custom HTML rendering that's more useful.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...