Java Reference
In-Depth Information
is located in the conf directory of the Tomcat distribution and contains a
number of <Context> tags that use attributes to specify additional informa-
tion about each web application. Write a program that uses a SAX parser
(preferably SAX 2) to parse the server.xml file and output the values of the
path and docBase attributes of each <Context> tag.
19-2. Using a DOM parser instead of a SAX parser, write a program that behaves
identically to the program you developed in Exercise 19-1.
19-3. Rewrite the server.xml parser again, using the JDOM API this time.
19-4. Write a Swing-based web application configuration program that can read
web.xml files, allow the user to modify them, and then write out the modi-
fied version. The program should allow the user to add new servlets to the
web application and edit existing servlets. For each servlet, it should allow
the user to specify the servlet name, class, initialization parameters, and URL
pattern.
19-5. Design an XML grammar for representing a JavaBeans component and its
property values. Write a class that can serialize an arbitrary bean to this XML
format and deserialize, or recreate, a bean from the XML format. Use the
Java Reflection API or the JavaBeans Introspector class to identify the
properties of a bean. Assume that all properties of the bean are either primi-
tive Java types, String objects, or other bean instances. (You may want to
extend this list to include Font and Color objects as well.) Further assume
that all bean classes define a no-argument constructor and all beans can be
properly initialized by instantiating them and setting their public properties.
Search WWH ::




Custom Search