Hi Matt,

Since I was working with legacy code, I don;t wanted to any code. 

I found that org.apache.catalina.loader.WebappLoader was setting the
URL.setURLStreamHandlerFactory() with DirContextURLStreamHandlerFactory,
basically jndi stream handler.
I updated this file rebuild the class & placed it in
%TOMCAT_HOME%/server/classes directory so as to force classloader to load my
class.

Now my custom URLStreamHandler is getting picked up properly.

Since WebAppLoader is using it for dealing with jndi://, I don't see any
issues with that my app seems to work fine.

Thanks,
Praveen M.



MK-24 wrote:
> 
> Hi Praveen,
> 
> pmanvi <praveena.manvi <at> gmail.com> writes:
> 
>> ...
>> 
>> Do let me know if you find some solution to the same.
> 
> actually, in the end I got it working using Christoph's suggestion to use
> the
> URL(scheme, host, port, path, handler) constructor. Unless that legacy
> system
> you're using unwraps and reconstructs your URL objects somewhere down the
> implementation (i.e., using the ctor that only takes a URL spec), this
> should
> work just fine.
> 
> Of course it's still merely a workaround, because you have to manually
> detect
> custom schemes and construct an appropriate handler for those. You could
> obviously move this code to a factory, but you will effectively only be
> duplicating what URLStreamHandlerFactory already does/is supposed to do...
> this
> sort of shows how absurd this issue actually is... I'm kinda disappointed
> that
> it receives so few attention on the Java issue tracker.
> 
> Anyway, HTH!
> 
> Best,
> Matt
> 
> 
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Custom-URL-handlers-in-Tomcat-web-app-tp15629476p16118205.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to