users@glassfish.java.net

Re: How do I register a new URLStreamHandler for a servlet?

From: Sahoo <Sahoo_at_Sun.COM>
Date: Wed, 17 Jun 2009 09:45:30 +0530

Are you using glassfish v2 or v3? In v3, you have a much better way of
doing it by using OSGi facilities to install URL handlers dynamically.
On v2, you have to do it using java.protocol.handler.pkgs system
property. You can edit it in jvm settings screen in admin console. Is it
possible that your hander class is not loadable?

Sahoo
glassfish_at_javadesktop.org wrote:
> I have an library which uses a couple of custom URLStreamHandlers in order to handle parsing of custom URL protocols. The app, standalone, works fine by modifying the system property java.protocol.handler.pkgs. However, once that code is embedded in a servlet, I get MalformedURLException every time I try to create a URL with the custom protocols. Specifying the property in the admin console doesn't have any effect, although it isn't clear where I would need to do that.
>
> How do I go about installing custom stream handlers in glassfish so that my servlet is able to open the same URLs that it could do standalone? A few hours of searching the documentation hasn't turned up an obvious fix. I don't really care about which servlet container I use, but Glassfish came with Netbeans so I was hoping it would be easy to use.
> [Message sent by forum member 'carlburke' (carlburke)]
>
> http://forums.java.net/jive/thread.jspa?messageID=351518
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>