Hi @v1101
In order to pass values to JSP, you are in right direction to use requestAttributes. But the parameter requestAttributes takes a map instead of a single value. In order to set a map and then pass as request parameter refer https://docs.adobe.com/content/help/en/experience-manager-htl/using/htl/block-statements.html#request-attributes.
public class Settings extends WCMUsePojo {
// used to pass is requestAttributes to data-sly-resource
public Map<String, Object> settings = new HashMap<String, Object>();
@Override public void activate() throws Exception {
settings.put("property1", "abc.html");
}
}
you can also use sling model to set key value pairs.
you can then call jsp like this:
<sly data-sly-use.myclass="com.adobe.examples.htl.core.hashmap.Settings" data-sly-include="${ '/apps/project-name/components/../manipulate.jsp' @ requestAttributes=myclass.settings}" />
In JSP file, you can get this property value like :
<%@include file="/libs/granite/ui/global.jsp"%>
<%=request.getAttribute("property1")%>
you can not use getparameter as it will provide you query parameter in the URL.
Hope it helps!
Thanks!
Nupur