Error using jstl inside component jsp
I'm using this simple tag
<c:set var="content" value="${sling:getResource(resourceResolver,/content/dam/imf/public/sampleicons)}" />
Getting an error
The function getResource cannot be located with the specified prefix
Complete jsp:
<%--
Directory Browser component.
Lists all resources in the directory
--%><%
%><%@include file="/libs/foundation/global.jsp"%>
<%
%><%@page session="false" %><%
%><%
// TODO add you code here
%>
<sling:defineObjects/>
<%
String url ="/content/dam/imf/public/sampleicons";
%>
This component lists all in the directory
<c:set var="content" value="${sling:getResource(resourceResolver,url)}" />
Reference used:
https://sling.apache.org/documentation/bundles/sling-scripting-jsp-taglib.html