Module personalities typically provide automatic access to features specific to the personality via custom manifest headers or other configuration mechanisms. There may be situations, however, for which programmatic access to such features is desirable or necessary. This section describes how to programmatically access personality-specific features from application code in a module.
The SpringSource dm Server automatically creates a
for Web Bundles and WAR files. When used in conjuction with an
an auto-configured Spring MVC
there is generally no need to access the
programmatically, since all components of the web application are configured
within the scope of the
itself. However, if you wish to access the
you can do so via the web application’s
The Web Personality subsystem stores the bundle’s
WebApplicationContext in the ServletContext under
the attribute name "
BSN is the
of your WAR or Web Bundle.
Alternatively, since the Web Personality subsystem also stores the
WebApplicationContext under the attribute name
with the value of the
constant, you may choose to use Spring MVC’s WebApplicationContextUtils’
methods to access the
WebApplicationContext without providing
an explicit attribute name.