Get return value from Fruego method on jsp page

1.使用Fuego在jsp页面中传递参数,一般来说都是和jstl标签相结合:
f:invoke var="${sampleForm}" methodName="method1" retAttName="retValue" retAttScope="Page"/
然后使用
c:set var="var1" value="${retValue}"/
<c:out value="${returnValue}">c:out value="${var1}"/

就可以取到返回值了

当然更常用的组合是返回一个数组,然后用来调用:
f:invoke var="${sampleForm}" methodName="method2" retAttName="retArray" retAttScope="Page"/
c:forEach var="arrayItem" begin="0" step="1" items="${retArray}" varStatus="status"
<c:foreach var="arrayItem" begin="0" step="1" items="returnArray">
.
.
.

/c:forEach
</c:foreach>
2.要注意的是
<c:choose>c:choose
  c:when   /c:when
<c:when></c:when>  c:when   /c:when
  c:otherwise  /c:otherwise</c:choose></c:out>

<c:out value="${returnValue}"><c:choose>/c:choose</c:choose>
just like swith in java, so if you want to descript some if, if relationship, you should use
c:if</c:out>

<c:out value="${returnValue}">/c:if
<c:if></c:if>
<c:if></c:if><f:invoke var="${sampleForm}" method="method1" retvalue="returnValue" scope="page"><c:set var="var1" value="${returnValue}"><c:out value="${returnValue}"><f:invoke var="${sampleForm}" method="method2" retvalue="returnArray" scope="page">
</f:invoke></c:out></c:set></f:invoke></c:out>

<c:if></c:if>

你可能感兴趣的:(C++,c,jsp,C#,F#)