I am trying to reference JS scrips for each portlet in gatein-resources.xml. https://docs.jboss.org/author/display/GTNPORTAL34/GDG-JavaScript+Resource+Management How do I reference them to each portlet? I am trying to use the portlet scope but not sure how to reference them. Is it by name or by path? ie
in example.jsp
<script src="<%=request.getContextPath()%>/js/lib/modules/pagination.js"></script>
in gatein-resources.xml
<portlet>
<name>/jsp/example.jsp</name>
<module>
<script>
<name>pagination</name>
<path>/js/lib/modules/pagination.js</path>
</script>
</module>
</portlet>
Edit:
If I just want to add all the javascript resources indepently from which portlet uses them, can I just add all of them like the below snippet? (I have multiple jsp files sharing different javascript files). Just trying to minimize amount of code/not sure which portlet uses which jsp file so just trying to add all of them at once. Do these jsp files need to be added to portlet.xml? I am confused about the difference between these jsp files and the .xml portlets in portlet.xml. Are these jsp files portlets as well? Sorry for my lack of understanding.
<scripts>
<name>first_resource</name>
<script>
<name>ABC_script</name>
<path>/abc.js</path>
</script>
<name>second_resource</name>
<script>
<name>XYZ_script</name>
<path>/xyz.js</path>
</script>
</scripts>
or maybe also add the tag for all the scripts listed above. Resource: shared scope in https://docs.jboss.org/author/display/GTNPORTAL34/GDG-JavaScript+Resource+Management
Thanks!