在两个jsp中使用相同的c:foreach

在两个jsp中使用相同的c:foreach,jsp,jstl,tiles,Jsp,Jstl,Tiles,我有两个jsp(body,comment),在body jsp中我编写了一个出版物的代码,在comment中 我写了发表的评论,所以我在body中创建了一个c:foreach,我想发送 P.publicationId以注释JSp。 我想知道我该怎么做谢谢 <c:foreach items="publication" var="P"> <c:set var="tetst" value="${p.pucationId}" scope="request" />

我有两个jsp(body,comment),在body jsp中我编写了一个出版物的代码,在comment中 我写了发表的评论,所以我在body中创建了一个c:foreach,我想发送 P.publicationId以注释JSp。 我想知道我该怎么做谢谢

<c:foreach items="publication"  var="P"> 
<c:set var="tetst" value="${p.pucationId}" scope="request" />
        <input id="pubID_${loop.index}" type="hidden" value="${p.publicationId}">

    <c:set var="imgvid" value="IMAGE_VIDEO"/>
    <c:set var="statut" value="STATUT"/>
</c:foreach>

我使用

要返回publicationid,解决方案是:

jsp1


JSP2(获取var)


<c:set var="test" value="${p}" scope="request" />
<c:set var="p"  value="${requestScope.test}"/>