Oracle GlassFish Server 3.0.1 Application Development Guide


To create a custom resource that provides URL instances to applications, follow these steps:

  1. Set the custom resource's factory class to org.glassfish.resources.custom.factory.URLFactory.

  2. Choose which of the following constructors to use:

    • URL(protocol, host, port, file)

    • URL(protocol, host, file)

    • URL(spec)

  3. Define properties according to the chosen constructor.

    For example, for the first constructor, define properties named protocol, host, port, and file. Example values might be http, localhost, 8085, and index.html, respectively.

    For the third constructor, define a property named spec and assign it the value of the entire URL.