问题
I have a component that instances 3 or more components. I need to pass one parameter for each of his sons Is there a way to do it?
For example a code like this:
<cq:include path="x" resourceType="compo">
<parameter....>
</cq:include>
回答1:
There is pretty easy solution:
- In your main component define variable with request scope
(
<c:set var="param" value="10" scope="request" />
). - In component,
which you include several times in main one you van use variable
${param}
来源:https://stackoverflow.com/questions/31320814/how-to-pass-parameters-through-components