I was using forEach for passing parameters to a function,the code is as follows
<
Your question is meaningless. There is no "passing parameters by <ui:repeat>
" and there is no "passing parameters using <c:forEach>
". Your words might make sense in some specific context - but the context is missing.
The two tags you describe do entirely different things: one builds a component (<ui:repeat>
), the other one pre-processes a document that will serve to build view. The difference is profound (beginning with the shape of UI that is created, the time when the binding is evaluated, interactions with saved GUI state...) and - judging from the way you ask the question - you need to understand a lot more before you tackle this specific problem. That's all right, just take your time.
But I have an honest advice: if <c:foreach>
works for you (if only by chance), then just use it! Don't try to replace it with something altogether different (and something that you don't get).