<%... @ Page Language = "Java" contenttype = "text/html; charset = UTF-8" %>
<%... @ Taglib uri = "http://beehive.apache.org/netui/tags-html-1.0" prefix = "netui" %>
<%... @ Taglib uri = "http://beehive.apache.org/netui/tags-databinding-1.0" prefix = "netui-Data" %>
<%... @ Taglib uri = "http://beehive.apache.org/netui/tags-template-1.0" prefix = "netui-template" %>
<%... @ Taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "C" %>
<%... @ Page import = "com. Bea. content. *" %>
<Netui: HTML>
<Head>
<Netui: base/>
</Head>
<Netui: Body>
<! -- For loop to display all the items -->
<Table border = "1">
<Tr>
<TD> title </TD>
<TD> author </TD>
<TD> email </TD>
</Tr>
<C: foreach Var = "Node" items = "$ {pageflow. currentpage}">
<C: Set Var = "nodevalue" Scope = "page" value = "$ {node}"/>
<%...
Node node = (node) pagecontext. getattribute ("nodevalue ");
Property titleprop = node. getproperty ("title ");
%>
<Tr>
<TD> <C: If test = "<% = titleprop! = NULL %> "> <% = titleprop. getvalue (). getstringvalue () %> </C: If> </TD>
<TD> </TD>
<TD> </TD>
</Tr>
</C: foreach>
</Table>
</Netui: Body>
</Netui: HTML>
Use the node variable in foreach:
Use <C: Set Var = "nodevalue" Scope = "page" value = "$ {node}"/> to set the variable "Node" to pagecontext, and then use pagecontext. getattribute ("nodevalue.
<%
Node node = (node) pagecontext. getattribute ("nodevalue ");
Property titleprop = node. getproperty ("title ");
%>
Note: In the set tag, if the attribute scope = "request" is passed through the request. getattribute ("nodevalue"); get, if scope = "session" through request. getsession (). getattribute ("nodevalue.