小编Ash*_*dey的帖子

如何使用jsp传递Object:将param标签包含到另一个jsp中

我试图使用jsp:include标签将DTO对象从一个jsp发送到另一个jsp.但它始终将其视为字符串.我无法在包含的jsp文件中使用DTO.

这是一个代码..

<c:forEach items="${attributeDTOList}" var="attribute" varStatus="status">  
         <jsp:include page="attributeSubFeatureRemove.jsp" >
             <jsp:param name="attribute" value="${attribute}" />
         </jsp:include>
</c:forEach>
Run Code Online (Sandbox Code Playgroud)

attributeSubFeatureRemove.jsp文件..

<c:set value="${param.attribute}" var="attribute" />
<c:forEach items="${attribute.subFeatures}" var="subAttribute">
    <c:forEach items="${subAttribute.attributeValues}" var="subValue">
        <c:if test="${ subValue.preSelectionRequired}">
            <c:set var="replaceParams" value=":${subAttribute.name}:${subValue.name}" />
            <c:set var="removeURL" value="${fn:replace(removeURL, replaceParams, '')}" />
        </c:if>
    </c:forEach> 
    <jsp:include page="attributeSubFeatureRemove.jsp">
        <jsp:param name="subAttribute" value="${subAttribute}" />
    </jsp:include> 
</c:forEach>
Run Code Online (Sandbox Code Playgroud)

这里我试图从param获取属性值,它总是发送String Type Value.有没有办法在attributeSubFeatureRemove jsp文件中发送Object(DTO)?请帮忙.

html java jsp jstl jsp-tags

19
推荐指数
1
解决办法
2万
查看次数

标签 统计

html ×1

java ×1

jsp ×1

jsp-tags ×1

jstl ×1