background image

Configuring Your Environment

<< Sample Code Organization | Running the Samples >>
<< Sample Code Organization | Running the Samples >>
100
S
TREAMING
API
FOR
XML
·
event
contains
EventParse.java
, which illustrates how to use the
XMLEv-
entReader
(event iterator) API to read an XML file.
·
filter
contains
MyStreamFilter.java
, which illustrates how to use the
StAX Stream Filter APIs. In this example, the filter accepts only
Start-
Element
and
EndElement
events and filters out the remainder of the
events.
·
readnwrite
contains
EventProducerConsumer.java
, which illustrates
how the StAX producer/consumer mechanism can be used to simulta-
neously read and write XML streams.
·
writer
contains
CursorWriter.java
, which illustrates how to use
XML-
StreamWriter
to write an XML file programatically.
Configuring Your Environment for
Running the Samples
The instructions for configuring your environment are the same as those for run-
ning the other J2EE Tutorial samples. Specifically, to configure your environ-
ment for running the StAX examples, follow the steps below.
Note: If you are configuring the samples to run in a Microsoft Windows environ-
ment, use UNIX-style forward slashes (
/
) rather than Windows-style backslashes
(
\
) to separate directory names when specifying paths in the steps below. For exam-
ple, if your Application Server PE installation is in
c:\Sun\AppServer
, specify
c:/Sun/AppServer
instead.
1. Set the following two properties in
<javaee.tutorial.home>/exam-
ples/common/build.properties
:
·
javaee.home
to the directory in which SJSAS PE 9.0 is installed
·
javaee.tutorial.home
to the directory in which the J2EE 1.4 Tutorial is
installed.
2. Specify the admin password used for your Application Server installation
in
<javaee.tutorial.home>/examples/common/admin-password.txt
.