XML Server Getting Started
This exercise requires additional file EchoLogon.jsp:
<%@ page import="
java.io.*,
javax.servlet.*,
javax.servlet.http.*,
org.w3c.dom.*,
org.apache.xerces.parsers.DOMParser,
org.xml.sax.*,com.cti.util.*,
com.cti.xmlsp.XPathAPI,
com.cti.*"%>
<%!
String getStackTraceAsString(Exception e) {
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
PrintWriter writer = new PrintWriter(bytes, true);
e.printStackTrace(writer);
return bytes.toString();
}
String getAttribute(Node node, String attribute) {
String result="";
NamedNodeMap attrMap = node.getAttributes();
Attr attr = null;
if (attrMap!=null) {
attr = (Attr) attrMap.getNamedItem(attribute);
if (attr!=null) result = attr.getValue();
}
return result;
}
String getNodeValue(Node node) {
String result="";
if (node!=null) {
2000 2002 Computer Technology Inc. All rights reserved.
Page 50
J2EE Web Hosting Tundra XML Server Pages J2EE Hosting
|
|
|
|
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved. |