Hi Markus, if you find bugs, please fix them ;) Regarding the different samples. That's been the second blog, I wrote two at the time. The given sample is for the WhiteBoard approach, but you can also have the Web-Container approach. See the first Blog for details, that's where I outsourced my thoughts of the time ;)
regards, Achim Am Di., 4. Feb. 2020 um 12:17 Uhr schrieb Markus Rathgeb < [email protected]>: > Hi all, > > the both examples and its mechanism differs (thanks for providing it). > > The one JB refers to is using a bundle header. This example has (the > time I tested it) not worked for me. My research (at the time I > comment this the first time) has been that this works for the usage of > the "Web Application Specification" only. I did not check it again, > but I was not aware that something has been changed. > > The one Achim refers to uses a HttpContextMapping service additional > to the Servlet service and sets the necessary properties. > Achim, thanks a lot for your example. This one is working for me! > > > > https://github.com/ops4j/org.ops4j.pax.web/blob/master/samples/whiteboard-extended/src/main/java/org/ops4j/pax/web/extender/samples/whiteboard/internal/Activator.java > > As it is only an example, it does not matter, but there is a bug in > this example. > All the http context mapping service registrations are assigned to > "httpContextMappingReg" and all servlet registrations to "servletReg". > The respective ...2 and ...3 variables are not used. > So, there is only one of each service unregistered and freed. > > Best regards, > Markus > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>
