Wednesday 15 August 2012

java - Sling - Getting child resources of a property -


I'm having trouble using the list method in the sling of the child and for me it is not necessary to know why it There is a very basic code snippet that looks for a resource called "Header" and it lists that the child is not receiving any error messages with my given qualities. Here's my code:

  iterator & lt; Resources & gt; ServiceList = resource.getChild ("header"). ListChildren () while (serviceList.hasNext ()) {resource child = serviceList.next (); ServiceLocationHeader = child.getProperties (). Get ("serviceLocationHeader", "")}   

Any ideas? I have been beaten on my head for hours at this time. Thanks!

If you are not getting any errors, then there may be a problem retrieving the contents. is? If for some reason, listChildren () returns empty for example?

In addition to this, if you are declaring a service transfer change before loop and only after turning it off, So you will not only set it to value from the property of the previous child ??? Can there be any problem with this content?

Finally, your call child.getProperties (). Get ("serviceLocationHeader",) is the wrong syntax ??? It requires second parameter to specify the default value or return type.

No comments:

Post a Comment