问一个关于jsp的超难度问题 我靠这么复杂,将你的树的tag看看,先!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我想难点是怎么用jsp技术实现类似java code中方法的递归调用public method { .... method();}这里的method在jsp中相当与显示一个节点的页面片断。 可以考虑做成一个java bean来处理啊! 奇怪了 你写个类里面实现递归,然后返回字符串然后在jsp中调用显示不就完了么,咋 这么费劲 可以用import来实现你要达到的效果,例如: <c:choose> <c:when test="${empty param.recursion}"> <table> <c:forEach var="catalog" items="${catalogList}"> <c:set var="catalog" scope="request" value="${catalog}"/> <c:set var="depth" scope="request" value="0"/> <c:import url="/WEB-INF/pages/pickCatalog.jsp?recursion=true"/> </c:forEach> </table> </c:when> <c:otherwise> <c:choose> <c:when test="${catalog.leafCatalog}"> <c:if test="${status.index%5==0}"> <tr> </c:if> <td> <c:if test="${status.index%5==0}"> <c:forEach begin="0" end="${depth}" step="1"> </c:forEach> </c:if> <html-el:multibox name="${param.form}" property="${param.property}" styleId="${catalog.id}"> <c:out value="${catalog.id}"/> </html-el:multibox> <c:out value="${catalog.name}"/> </td> <c:if test="${status.index%5==5-1||status.last}"> </tr> </c:if> </c:when> <c:otherwise> <tr> <td> <c:forEach begin="0" end="${depth}" step="1"> </c:forEach> <b><c:out value="${catalog.name}"/></b> </td> </tr> </c:otherwise> </c:choose> <c:forEach var="child" items="${catalog.children}" varStatus="status"> <c:set var="catalog" scope="request" value="${child}"/> <c:set var="depth" scope="request" value="${depth+1}"/> <c:set var="status" scope="request" value="${status}"/> <c:import url="/WEB-INF/pages/pickCatalog.jsp"/> <c:set var="depth" scope="request" value="${depth-1}"/> </c:forEach> </c:otherwise></c:choose> 问一个关于WEBSPHERE的问题。 关于hibernate的级联删除和级联更新 jsp中导出Excel表格的问题 java页面数据抓取 想通过网络来监控实时采集的数据,这个实时监控的网络程序该采用什么样的解决方案?欢迎各抒己见! 关于页面自动跳转???在线等 50分求一个JavaScript函数,急!!!! JSP页面通过<A HREF="">转到Servlet中,Servlet怎样得到JSP的FORM中数据! jsp + my sql 的getDate("inDate") 问题! 如何在客户端存储数据? ResultSet 作为返回值,在JSP中取数据问题。 package的问题
public method {
....
method();
}
这里的method在jsp中相当与显示一个节点的页面片断。
你写个类里面实现递归,然后返回字符串
然后在jsp中调用显示不就完了么,咋 这么费劲
<c:when test="${empty param.recursion}">
<table>
<c:forEach var="catalog" items="${catalogList}">
<c:set var="catalog" scope="request" value="${catalog}"/>
<c:set var="depth" scope="request" value="0"/>
<c:import url="/WEB-INF/pages/pickCatalog.jsp?recursion=true"/>
</c:forEach>
</table>
</c:when>
<c:otherwise>
<c:choose>
<c:when test="${catalog.leafCatalog}">
<c:if test="${status.index%5==0}">
<tr>
</c:if>
<td>
<c:if test="${status.index%5==0}">
<c:forEach begin="0" end="${depth}" step="1">
</c:forEach>
</c:if>
<html-el:multibox name="${param.form}" property="${param.property}" styleId="${catalog.id}">
<c:out value="${catalog.id}"/>
</html-el:multibox>
<c:out value="${catalog.name}"/>
</td>
<c:if test="${status.index%5==5-1||status.last}">
</tr>
</c:if>
</c:when>
<c:otherwise>
<tr>
<td>
<c:forEach begin="0" end="${depth}" step="1">
</c:forEach>
<b><c:out value="${catalog.name}"/></b>
</td>
</tr>
</c:otherwise>
</c:choose> <c:forEach var="child" items="${catalog.children}" varStatus="status">
<c:set var="catalog" scope="request" value="${child}"/>
<c:set var="depth" scope="request" value="${depth+1}"/>
<c:set var="status" scope="request" value="${status}"/>
<c:import url="/WEB-INF/pages/pickCatalog.jsp"/>
<c:set var="depth" scope="request" value="${depth-1}"/>
</c:forEach>
</c:otherwise>
</c:choose>