If you are using OSGi Whiteboard however, the context path of any ServletContextHelpers is defined as a service property. In this way should be able to use any of the available mechanisms that support reconfiguration of services, like ManagedService(Factory) or Declarative Services to change the value during runtime.
However, WABs are going to be much more problematic in that the information is typically encoded in the headers of the bundle. - Ray On Thu, Aug 18, 2016 at 8:48 AM, Thomas Watson <tjwat...@us.ibm.com> wrote: > Unfortunately there is no standard way to change the context path of your > WAB dynamically after the bundle has been installed. > > > Tom > > > > ----- Original message ----- > From: Peter Kullmann <p.kullm...@arenae.ch> > Sent by: osgi-dev-boun...@mail.osgi.org > To: osgi-dev@mail.osgi.org > Cc: > Subject: [osgi-dev] Configure Web-ContextPath > Date: Thu, Aug 18, 2016 4:02 AM > > In one of our apps we want to configure the context path of a web > application bundle. I only know of two ways to specify the context path: > One is the manifest header "Web-ContextPath“ and the other is to use a > „webbundle:…?Web-ContextPath=...“ URL to install the bundle. I would like > to be able to set a system property with the context path (or better using > configuration admin). My current solution goes along these ways: > > wabBundle.uninstall(); > Bundle newWabBundle = bc.installBundle("webbundle:" + embeddedUrl > + "?Web-ContextPath=" + contextPath); > newWabBundle.start(); > > but that seems clumsy and prolongs startup time. I’m sure there must be a > way that is more elegant and efficient than this. Any ideas are greatly > appreciated. > > Thanks > Peter > > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev > > > > > _______________________________________________ > OSGi Developer Mail List > osgi-dev@mail.osgi.org > https://mail.osgi.org/mailman/listinfo/osgi-dev > -- *Raymond Augé* <http://www.liferay.com/web/raymond.auge/profile> (@rotty3000) Senior Software Architect *Liferay, Inc.* <http://www.liferay.com> (@Liferay) Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)
_______________________________________________ OSGi Developer Mail List osgi-dev@mail.osgi.org https://mail.osgi.org/mailman/listinfo/osgi-dev