如何获得我的JSP标记输出以正确显示在另一页上?

时间:2018-08-15 22:13:24

标签: jsp jstl rendering jsp-tags jstl-functions

我正在使用Wildfly 11和Java8。我有这个自定义标记文件...

<%@ taglib prefix="c"   uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn"  uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ attribute name="var" required="true" type="java.lang.String" rtexprvalue="false"%>
<sec:authentication property="principal.products" var="productList"/>
<c:set var="newEdition" value="${fn:length(productList) > 0}" />
<c:forEach var="product" items="${productList}">
        <c:if test="${not product.newVersion}">
                <c:set var="newEdition" value="${false}" />
        </c:if>
</c:forEach>
${newEdition}

我想返回该文件的输出,

${newEdition}

值,在另一页上。我在其他页面上有这个

<mytags:newVersion var="newEdition" />
modeModule.setnewVersion(${newEdition});

但是渲染的输出实际上是

true



modeModule.setnewVersion();

我不清楚如何调整代码,以使该值正确插入我想要的位置。我希望渲染的输出是

modeModule.setnewVersion(true);

0 个答案:

没有答案
相关问题