How to pass parameters through components

馋奶兔 提交于 2019-12-24 15:22:36

问题


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:

  1. In your main component define variable with request scope (<c:set var="param" value="10" scope="request" />).
  2. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!