URLs and protocol handlers

We've seen how a directory service implementation lets us abstract away the details of how a context's resources are made available. But that is only part of the story.

In this section, we'll look at how we might plug into Java's standard protocol handler mechanism to make the identification and retrieval of resources easy and intuitive. So please fasten your seatbelts as we enter the exotic world of Java protocol handlers!

Accessing resources

When a servlet container element, such as a servlet or filter, needs to access a static resource, it should avoid using hardcoded paths to that file. Hardcoding paths can hurt the portability of an application across servlet containers or result in failure when the web application ...

Get Tomcat 6 Developer's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.