Thanks for your review Chris.
Regarding the resources, in fact my document was wrong. I am not
modifying the core Vaadin bundle at all. Instead I use the
HttpService's registerResources method to ensure that the resources
already existing inside the core vaadin bundle are accessible under
the /VAADIN context path. This is the purpose of the HttpContext I
mentioned: it merely maps the external HTTP URL for the resource (e.g.
http://example.com/VAADIN/themes/default/styles.css) to the internal
Java resources, which are loaded via Bundle.getResource().
The other use of HttpContext in my code is to ensure that Application-
specific resources are loaded from the Application bundles. When
registering a servlet with HttpService, we always have the option to
pass in an HttpContext, or we can pass in null. If null is passed then
a default HttpContext is used, and (at least on Equinox) this would
cause resources to be loaded from the calling bundle... i.e. the
central "vaadinbridge" bundle, rather than the application's bundle. I
think this may have been the cause of the problems Peter described.
I agree with you that static resources should be loaded from a static
resource server like Apache. Since the core Vaadin resources are all
under the /VAADIN path, I assume that Apache can be configured to
serve those resources while other URLs go to the Servlet engine. In
that scenario it certainly doesn't hurt to have the resources mapped
in the Servlet engine as well. They will always be there as a
fallback, just in case there is no fronting Apache server, or it has
not been configured properly.
Cheers
Neil
> I've been having a look at Neil's OSGi approach to Vaadin (
http://njbartlett.github.com/#VaadinOSGi ) as compared with my own and
> Neil's OSGi experience obviously wins through. :)
>
> I like the de-coupling from DS, where as mine requires DS because of
> the Component Factory approach and of course Neil's approach has the
> ability to add more property based meta-data.
>
> Some other comments:
>
> Resources - the problem with Neil's approach seems to be that the
> Vaadin bundle would need to be changed. My approach doesn't change
> the standard Vaadin jar/bundle at all. A servlet handles the /VAADIN
> request and loads the resource directly from the Vaadin bundle uses
> the bundle's
>
> Plus, I'm of the opinion that static resources should not be being
> served by the OSGi container in a production environment - better to
> put an Apache web server in front (for example) and serve them from
> there, which is easy to do as all you do is serve static content for
> /VAADIN path and let everything else proxy through to the OSGi server.
>
> Neil, I couldn't quite get my head around your suggestion of using
> HttpContext - could you provide a code sample for that, please, as I
> think I'm missing something useful there.
>
> Framework:
>
> An earlier attempt at OSGi / Vaadin application (one of the things
> that helped me find Vaadin) introduced modules and I like this idea:
http://vaadin.com/wiki/-/wiki/Main/Creating%20a%20Modular%20Vaadin%20...