Thanks dsklyut. It worked.
Is this understanding correct -
Host can create Root WebApplicationContext using org.springframework.web.context.ContextLoaderListe ner and also servlet (dispatcher) WebApplicationContext and Host can access all the OSGi services and beans in Root WebApplicationContext.
ServerOsgiBundleXmlWebApplicationContext for root WebApplicationContext is configured using -
Code:
<context-param>
<param-name>contextClass</param-name>
<param-value>
com.springsource.server.web.dm.ServerOsgiBundleXmlWebApplicationContext
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
Whereas, a slice can only create WebApplicationContext for defined DispatcherServlet. And to create an OSGi enabled WebApplicationContext for slice we need to give the following -
Code:
<servlet>
<servlet-name>dispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>
com.springsource.server.web.dm.ServerOsgiBundleXmlWebApplicationContext
</param-value>
</init-param>
</servlet>
Regards,
Pranav