我很難理解爲什麼要使用資源而不是吊索中的節點。所以說我有一些簡單的訪問節點如下: NodeIterator headerNode = currentNode.getNodes();
//loop through and do something with the nodes.
你將如何工作的資源,而不是節點。我聽說你通常應該在資源上工作而不是節點。但爲什麼?我真的不明白這會有什麼好處。我認爲
我已經習慣了使用吊索節點和習慣於通過節點的東西,如循環資源的屬性: NodeIterator headerNode = currentNode.getNodes();
//loop through and do something
但我會怎麼做,如果我試圖環通過資源的所有properties。我真的迷失在這裏。所以目前我只是簡單地獲取資源的一個屬性。但是如果我想抓住所有資源的所有屬性怎麼辦?
此代碼片段應該可以獲取吊索中的頁面屬性。 我爲什麼會收到此錯誤:Please check if the declared type is right and if the method exists. private String properties;
public void setProperties(String properties){
this.properties = p
我發現Sling's ability to associate Servlets具有某些資源類型,選擇器和擴展,這些方法在組件開發中非常有用。 現在我開始研究ComponentFilterChain &想創建僅針對特定資源類型註冊的過濾器,與上面的Servlet一樣。 從Example filters on the Sling project,我看到有一個pattern屬性,您可以申請特定的路徑,