java - Sling - Get properties of a resource -


i'm new sling apologize in advance. i've got simple script can't work. want "lastmodified" property of specific resource located in jcr.

resource getresource = resourceresolver.getresource("/content/aboutpage/jcr:content/list"); valuemap properties = resource.adaptto(valuemap.class); string lastmodified = properties.get("jcr:lastmodified", string.class); 

instead error below:

duplicate local variable properties 

any appreciated! thanks!

"duplicate local variable" in java or jsp code means there's variable name in same scope. if didn't define variable yourself, included other code does.

as noticed, need change variable's name avoid issue.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -