我一直在閱讀關於新Sling Taglib版本1.3的這篇文章http://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html,因爲我想開始使用像listChildren這樣的新JSTL函數,以便我可以避免使用Java scriptlet我的組件。在CQ5.6.1項目中使用Sling Taglib 1.3版
當我使用taglib聲明
<%@taglib prefix="sling" uri="http://sling.apache.org/taglibs/sling" %>
在我的組件JSP,當我把組件放入我的PARSYS我收到以下錯誤
org.apache.sling.api.scripting.ScriptEvaluationException:
org.apache.sling.scripting.jsp.jasper.JasperException:
The absolute uri: http://sling.apache.org/taglibs/sling cannot be resolved
in either web.xml or the jar files deployed with this application
在我的Maven pom.xml文件中我有依賴關係
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.scripting.jsp.taglib</artifactId>
<version>2.2.0</version>
<scope>provided</scope>
</dependency>
該項目生成正確,並正確安裝。
有誰知道如何配置一個CQ 5.6.1項目使用Sling Taglib 1.3版軟件包版本2.2.0與URI http://sling.apache.org/taglibs/sling
?