Bug 26701 - Enabling web applications to register their own stream handlers
Enabling web applications to register their own stream handlers
Status: RESOLVED FIXED
Product: Tomcat 4
Classification: Unclassified
Component: Catalina
4.1.24
All All
: P3 enhancement (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2004-02-05 21:30 UTC by Sankaranarayanan Ganapathy
Modified: 2011-03-08 06:05 UTC (History)
1 user (show)



Attachments

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.