... c:\jakarta-tomcat\classes;c:\jakarta-
tomcat\lib\ant.jar;c:\jakarta-tomcat\lib\jaxp.jar;c:\jakarta-
➥
tomcat\lib\servlet.jar;c:\jakarta-tomcat\lib\parser.jar;c:\jakarta-tomcat\lib\we
➥
bserver.jar;c:\jakarta-tomcat\lib\jasper.jar;c:\jakarta-
➥
tomcat\lib\xalanservlet.jar;c:\jakarta-tomcat\lib\xerces.jar;c:\jakarta-
➥
tomcat\lib\xalanj1compat.jar;c:\jakarta-tomcat\lib\aaxalan.jar;c:\jdk1.3\lib\too
➥
ls.jar
2001-05-23 ... c:\jakarta-tomcat\classes;c:\jakarta-
tomcat\lib\ant.jar;c:\jakarta-tomcat\lib\jaxp.jar;c:\jakarta-
➥
tomcat\lib\servlet.jar;c:\jakarta-tomcat\lib\parser.jar;c:\jakarta-tomcat\lib\we
➥
bserver.jar;c:\jakarta-tomcat\lib\jasper.jar;c:\jakarta-
➥
tomcat\lib\xalanservlet.jar;c:\jakarta-tomcat\lib\xerces.jar;c:\jakarta-
➥
tomcat\lib\xalanj1compat.jar;c:\jakarta-tomcat\lib\aaxalan.jar;c:\jdk1.3\lib\too
➥
ls.jar
2001-05-23 ... CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;c:\xalan-j_1_2_2\xerces.jar
set CLASSPATH=%CLASSPATH%;c:\xalan-j_1_2_2\xalan.jar
This will cause some extra work when you want to access Xalan...
...
value=“<tree><topic>Chess Players
Chat</topic><moderator>Harvey
Wilkinson</moderator></tree>”>
Notice ... database management system
because handling chat data is an obvious job.We decided against that for several rea-
sons. One is that we did not want to assume that all our readers are familiar ... the Web application.The goal was to make the XML data from the
chat forum active. By “active,” we mean that its form and content would drive the
appearance and the dynamics of the Web application.
A...
... to aWeb Application User
A servlet can use the attributes of
HttpSession
objects to store information about
each user.That information will then be available to display to each user, for example,
in ... processor as
part of our
TransformTag
class.
Displaying the available chats would mean showing both the chat subject and the
chat topic.We began with the following vague idea:We would create a style ... be as fully functional as it is.
The bonForum Web app is still evolving. It seems that we must always stress that
one of its main reasons for existence is as an experimental platform for studying...
... logic, by
making one more variable available to each JSP-produced page of a bonForum
instance.
The incoming request parameters are validated and made available to the Web
application in whatever ...
bonForumCommand
values, using the
highest bonForum variable ranking for each
bonForumCommand
.
Table 8.6 bonForum Variables: Priority, Name, Destination
bonForum Variable
bonForumCommand
1
chatMessage ... visitor_joins_chat_frame
3
chatModerated visitor_joins_chat_frame
5
chatTopic visitor_starts_chat_ready
5
chatModerated visitor_starts_chat_ready
7
chatSubject visitor_starts_chat_frame
10
chatMessagesPageSize...
... there are two such XSLT classes, one for Xalan-Java 1 and one for Xalan-
Java 2.
Simplifying greatly, here are the statements called by the
TransformTag
class to get
its XML database in a string:
private ... database (now a
ForestHashtable
)
n
Initializes the XML database for use as a chat Web app
n
Loads XML files into a database using its methods
n
Dumps the content of the database as XML in a string
n
Provides ... + chatTopic + “]”;
// ‘_’ is separator in a chatItem
// ‘.’ is separator in pathNameHashtable keys
fakeChatItem = fakeChatItem.replace(‘.’, ‘_’);
// example fakeChatItem:
// Animals_Bird_Hawk_[Medieval...
... will assume as it translates the tag that
these variables are available as page attributes. Later, when we look at the translated
Java code fora Tag Handler instance, you can see where the value ...
TagExtraInfo
.That means that the JSP container will be capa-
ble of using this class at translation or compilation time to get information about vari-
ables that are used in the Web application. ... that.We certainly do not want a copy of the database for each thread, so that must
be shared. In the prototype bonForum, the database is a
ForestHashtable
, which
extends the
Hashtable
class, which...
... two
classes to encapsulate the steps required for either
Xalan-Java 1
or
Xalan-Java 2
.The
classes are called
Xalan1Transformer
and
Xalan2Transformer
. Each has one method
called
transform
, which ... action tag:
! transform tag >
<tag>
<name>transform</name>
<tagclass>de.tarent.forum.TransformTag</tagclass>
<teiclass>de.tarent.forum.BonForumTagExtraInfo</teiclass>
<bodycontent>JSP</bodycontent>
<info>
XSLT ... %><HR/>
</bon:transform>
All the various ways of using the
transform
tag, discussed here, are made available by
the
TransformTag
class. It relies on other classes to carry out the actual transform...
... watermark.
426
Chapter 11 XML Data Storage Class: ForestHashtable
tested for escaped quotes and also catches some errors such as no closing quotes in an
attribute value and an
attributeName
argument ... code, as well as Chapter 8.
The addNode() Method’s nodeKeyHashtable Cache
In the
ForestHashtable
class, the public classes that add data nodes all call a private
class called
addNode()
.The
addNode()
method ...
Hashtable
objects, named
nodeNameHashtable
, is created by the following
statement from the file ForestHashtable.java:
public NodeNameHashtable nodeNameHashtable = new NodeNameHashtable();
Notice that a class...
... watermark.
615
C.25 Filename: Projects\bonForum\src\de\tarent\forum\OutputPathNamesTag.java
}
case ‘&’: {
str.append(“&”);
break;
}
case ‘“‘: {
str.append(“"”);
break;
}
case ‘\r’:
case ‘\n’: ... javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
// Imported TraX classes
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.stream.StreamSource;
import ... Currently, three values: “Xalan Java 1”, “Xalan Java 2”, or
“xalanVersion”.
* If type is “xalanVersion”, the tag object looks for an application
* attribute of the same name and uses its value to select...