阅读有关 Sling 的手册http://sling.apache.org/site/46-line-blog.html
将文件夹 blog 和 blog.html 添加到目的地:
\launchpad\content\src\main\resources\content\
但仍无法从 URL 访问它:
http://localhost:8080/blog/blog.html
错误:
The requested URL /blog/blog.html resulted in an error in org.apache.sling.servlets.resolver.internal.defaults.DefaultErrorHandlerServlet.
Request Progress:
0 (2012-06-14 15:12:32) TIMER_START{Request Processing}
0 (2012-06-14 15:12:32) COMMENT timer_end format is {<elapsed msec>,<timer name>} <optional message>
0 (2012-06-14 15:12:32) LOG Method=GET, PathInfo=/blog/blog.html
0 (2012-06-14 15:12:32) TIMER_START{ResourceResolution}
12 (2012-06-14 15:12:32) TIMER_END{12,ResourceResolution} URI=/blog/blog.html resolves to Resource=NonExistingResource, path=/blog/blog.html
...
有人将内容添加到 Sling 启动板目录吗?
更新:
内容(blog.html 文件)已添加到本地文件夹:
d:\workspaceSling\sling\launchpad\content\src\main\resources\content\blog
正如文章中所建议的那样(据我所知)
它是从完成mvn clean install
的d:\workspaceSling\sling\launchpad\content\pom.xml
,所以在目标中得到了结构:
d:\workspaceSling\sling\launchpad\content\target\classes\content\blog\blog.html
反正http://localhost:8080/blog/blog.html
不可用
1.此网址可用:
http://localhost:8080/index.html
它对应于本地文件:
d:\workspaceSling\sling\launchpad\content\src\main\resources\content\index.html
2.此 URL 也可用:
http://localhost:8080/sling-test/sling/sling-test.html
它对应于本地文件:
d:\workspaceSling\sling\launchpad\content\src\main\resources\content\sling-test\sling\sling-test.html
因此,Apache Sling 服务器不显示我的自定义手动添加内容的核心问题