March 2002
Intermediate to advanced
592 pages
13h 13m
English
In this chapter, we will build a generic servlet to intercept all XML requests within the xmlbook Web application.
The servlet will use the following business rules:
It returns a file-not-found error when the requested XML file doesn't exist.
The XML file is parsed to determine whether it declares a stylesheet. If a stylesheet has been declared, it's to be applied against the XML file. The results are sent back to the user instead of the original XML file.
To speed access, the results of the parsing of the XML file will be cached to memory space. The cache will have one of three values: a filename when the stylesheet is found, false when no stylesheet has been found, or null if the parsing hasn't been performed. ...
Read now
Unlock full access