KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > barracuda > tutorials > comp > HelloWorld2Footer


1 package org.enhydra.barracuda.tutorials.comp;
2
3 import java.io.*;
4 import java.util.*;
5 import javax.servlet.*;
6 import javax.servlet.http.*;
7
8 import org.w3c.dom.*;
9 import org.enhydra.xml.xmlc.*;
10
11 import org.enhydra.barracuda.core.comp.*;
12 import org.enhydra.barracuda.core.util.dom.*;
13 import org.enhydra.barracuda.tutorials.xmlc.*;
14
15 /**
16  * Here's an example of HelloWorld using the BTemplate
17  * component
18  */

19 public class HelloWorld2Footer {
20
21     public static Node getNode(ViewContext vc) {
22         return getNode(vc.getElementFactory().getDocument());
23     }
24     
25     public static Node getNode(Document doc) {
26 // XMLCFactory xmlcFactory = new XMLCStdFactory(doc.getClass().getClassLoader(), new StreamXMLCLogger());
27
// Node footerNode = xmlcFactory.create(HelloWorld2_footerHTML.class).getElementById("Footer");
28
Document footer = null;
29         //load the localized DOM template
30
try {footer = DefaultDOMLoader.getGlobalInstance().getDOM(HelloWorld2_footerHTML.class);}
31         catch (IOException ioe) {/*logger.fatal ("Fatal Error loading DOM template:", ioe);*/}
32         Node footerNode = ((HelloWorld2_footerHTML)footer).getElementFooter();
33         return doc.importNode(footerNode, true);
34     }
35 }
36
Popular Tags