Bug 26701 - Enabling web applications to register their own stream handlers
Summary: Enabling web applications to register their own stream handlers
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 4.1.24
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2004-02-05 21:30 UTC by Sankaranarayanan Ganapathy
Modified: 2011-03-08 06:05 UTC (History)
1 user (show)


Note You need to log in before you can comment on or make changes to this bug.
Description Sankaranarayanan Ganapathy 2004-02-05 21:30:18 UTC
A stream handler factory can be registered once per VM and tomcat registers the 
DirContextStreamHandlerFactory for the jndi protocol. However if there are web 
applications running inside that want to register handlers for custom scheme 
currently it is not possible.

Can the DirContextStreamHandlerFactory be enhanced to allow applications to 
register stream handler for custom schemes they might have. Or better can this 
be a made a property in the context.xml file ?

Is this already there - or can this enhanced in the future?
Comment 1 Mark Thomas 2011-03-06 17:15:06 UTC
This has been fixed in 7.0.x and will be included in 7.0.11 onwards.

Add as many factories as you wish using:
DirContextURLStreamHandlerFactory#addUserFactory(URLStreamHandlerFactory factory)

The class loader hierarchy means that the factory will have to be in $CATALINA_BASE/lib.
Comment 2 Mark Thomas 2011-03-08 06:05:33 UTC
I would add that adding stream handlers via the java.protocol.handler.pkgs system property was and remains an alternative option.