매우 간단한 코드 조각이 있습니다. 그 이유는 무엇입니까 경우에만 루프의 첫 번째 요소를 잡으려고 내가 그것을 출력하려고하면 내 JSP로. JcrUtils.getChildNodes는 각 속성 을 반복 할 것이라고 생각한 NodeIterator를 반환합니다. 여기 코드는 다음과 같습니다Groovy는 루프의 첫 번째 요소 만 가져옵니다.
def headerNode = JcrUtils.getChildNodes(LINKS).find{
it.hasProperty("headerTitle")
it.hasProperty("headerMeta")
}
selectHeaderTitle = headerNode.getProperty("headerTitle").getString()
selectHeaderMeta = headerNode.getProperty("headerMeta").getString()
JSP : 어떤 도움을 주시면 더 좋구요
${header.selectHeaderTitle}
${header.selectHeaderMeta}
!
고마워요,하지만 지금은 속성의 마지막 인스턴스가 나타납니다. JSP에서 잘못된 일을하고 있습니까? 위의 내용이 모든 속성의 목록을 반환 할 것이라고 생각했습니다. –