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>&lt;employees> 
33         &lt;employee title="CEO">
34             &lt;first>Mary&lt;/first>
35             &lt;last>Smith&lt;/last>
36         &lt;/employee> 
37         &lt;employee title="President">
38             &lt;first>Mark&lt;/first>
39             &lt;last>Jones&lt;/last>
40         &lt;/employee> 
41         &lt;employee title="Vice President">
42             &lt;first>Matt&lt;/first>
43             &lt;last>Nelson&lt;/last>
44         &lt;/employee> 
45         &lt;employee title="Salesperson">
46             &lt;first>John&lt;/first>
47             &lt;last>Doe&lt;/last>
48         &lt;/employee> 
49         &lt;employee title="Office Manager">
50             &lt;first>Jane&lt;/first>
51             &lt;last>Doe&lt;/last>
52         &lt;/employee> 
53     &lt;/employees></pre>
54     <p><a href="index.jsp">Back to Repeater Samples Home</a>
55 </body>
56 </html>