Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

<jsp:include> with variable number of <jsp:param> elements

865050May 27 2011 — edited Jun 15 2011
I have a need where I have an unknown number of parameters to include with my call for a <jsp:include>. The parameters are stored in a map that I want to iterate over and include with my <jsp:include> request. I wanted to accomplish something like this.

<jsp:include page="mypage.jsp">
<c:forEach items=${paramsMap} var="param">
<c:param name="${param.key}" value="${param.value}"/>
</c:forEach>
</jsp:include>

I understand that the <jsp:include>/<jsp:param> construct does not allow for any foreign elements to exist within the body of the <jsp:include> tag.

Is there any way to accomplish this?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2011
Added on May 27 2011
2 comments
749 views