XMLString.jsp Sample
This topic inludes the source code for the XMLString.jsp Sample.
Sample Location
This sample is located in the following directory in your WebLogic Workshop installation:
BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui_databinding/repeater/
Sample Source Code
01 <%@ page language="java" contentType="text/html;charset=UTF-8"%>
02 <%@ taglib uri="netui-tags-databinding.tld" prefix="netui-data"%>
03 <%@ taglib uri="netui-tags-html.tld" prefix="netui-html"%>
04 <%@taglib prefix="netui" uri="netui-tags-html.tld"%>
05
06 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
07 <html>
08 <head>
09 <title>Read Test</title>
10 <netui:base/>
11 </head>
12 <body>
13 <jsp:include page="/resources/jsp/header.jsp"/>
14 <p><b>An XMLString rendered in an HTML table</b>
15 <p><netui-data:callPageFlow method="getXMLStr" resultId="xml"/>
16 <netui-data:repeater dataSource="{pageContext.xml.employee}">
17 <netui-data:repeaterHeader>
18 <table border=1><tr><td><b>Title</b></td><td><b>First</b></td><td><b>Last</b></td></tr>
19 </netui-data:repeaterHeader>
20 <netui-data:repeaterItem>
21 <tr>
22 <td><netui-html:label value="{container.item.@title}"/></td>
23 <td><netui-html:label value="{container.item.first}"/></td>
24 <td><netui-html:label value="{container.item.last}"/></td>
25 </tr>
26 </netui-data:repeaterItem>
27 <netui-data:repeaterFooter>
28 </table>
29 </netui-data:repeaterFooter>
30 </netui-data:repeater>
31 <p>The XMLString rendered above:
32 <pre><employees>
33 <employee title="CEO">
34 <first>Mary</first>
35 <last>Smith</last>
36 </employee>
37 <employee title="President">
38 <first>Mark</first>
39 <last>Jones</last>
40 </employee>
41 <employee title="Vice President">
42 <first>Matt</first>
43 <last>Nelson</last>
44 </employee>
45 <employee title="Salesperson">
46 <first>John</first>
47 <last>Doe</last>
48 </employee>
49 <employee title="Office Manager">
50 <first>Jane</first>
51 <last>Doe</last>
52 </employee>
53 </employees></pre>
54 <p><a href="index.jsp">Back to Repeater Samples Home</a>
55 </body>
56 </html>
|