Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges


Get Image Files from JCR node through JCR API


Level 2

Hi all, 

I have image files in a folder under DAM folder in JCR hierarchy.

How can I get the Image Files from JCR and display in a html page in my application?

I need to List images in a html page for display to user, so that user can pick some images from list of images in html page,

I need to query the Image files in JCR repository.


How to achieve this?

any suggestion is greatly appreciated. 

1 Accepted Solution


Correct answer by
Level 10
0 Replies


Correct answer by
Level 10

See the article -- It walks you through this use case. 


Level 6

Chekout this :

You can use the below code :

String xPathQuery = “/jcr:root/content/mydemosite/documents/Sales//element(*,nt:file)[jcr:like(@name,'%"+docName+"%')]“; //docName is search query
xPathQuery += ” order by @jcr:score ascending”;
Query query = session.getWorkspace().getQueryManager().createQuery(xPathQuery, Query.XPATH);
QueryResult result = query.execute();