I think what he means with having the component listen to the template
is that the template needs to set some properties for the page which the
component will "read" eg.Template 1 (for the products page):<%
pageContext.setAttribute("pagetype","products"); %>Template 2 (for the
suppliers page):<% pageContext.setAttribute("pagetype","suppliers");
%>Then the productlist.jsp could simple read that property like:
//Include the corresponding script (view) here
//Include the other script (view) her...