I wouldn’t expect you to need anything specific in your bnd file. 
Web-ContextPath is part of a different OSGi specification (the Web Application 
Bundle spec) so there shouldn’t be any need for that at all.

Best Regards,

Tim

> On 23 Oct 2018, at 17:06, Leschke, Scott <slesc...@medline.com> wrote:
> 
> Thanks Tim.  That was the problem. I noticed that just after I sent the email 
> but hadn’t had a chance to try it yet.  I pulled that from a YouTube video 
> Ray Auge did way back in 2014 and sort of blindly regurgitated what I saw.  
>  
> There’s something else I noticed though.  It would seem that it’s still 
> necessary to define
> Web-ContextPath .bnd file as it doesn’t appear to work without that.  Is that 
> right?
>  
> From: Tim Ward <tim.w...@paremus.com> 
> Sent: Monday, October 22, 2018 4:28 PM
> To: user@karaf.apache.org
> Subject: Re: Http Whiteboard
>  
> I’m pretty sure that your ServletContextHelper isn’t advertised as a service 
> and is therefore invisible to the whiteboard. ServletContextHelper is not an 
> interface so you need to be explicit. 
>  
> Tim
> 
> Sent from my iPhone
> 
> On 22 Oct 2018, at 23:04, Leschke, Scott <slesc...@medline.com 
> <mailto:slesc...@medline.com>> wrote:
> 
>  
> I’ve in the process of trying to convert a couple of servlets over to user 
> HttpWhiteboard. I looked online for an example and it seemed pretty straight 
> forward.
> Based on my understanding, I came up with the following but it doesn’t work. 
> Jetty doesn’t have a myApp context. I assume there is something missing?
>  
> Help?
>  
> Scott
>  
>  
> @Component(
>        property  = {
>               HTTP_WHITEBOARD_CONTEXT_NAME + '=' + ContextHelper.CTX_NAME,
>               HTTP_WHITEBOARD_CONTEXT_PATH + '=' + ContextHelper.CTX_PATH
>        }
> )
> public class ContextHelper
>        extends org.osgi.service.http.context.ServletContextHelper
> {
>        public static final String CTX_NAME = "myApp";
>        public static final String CTX_PATH = '/' + CTX_NAME;
> }
>  
>  
> @Component(
>        name      = “myApp.listings",
>        property  = {
>               HTTP_WHITEBOARD_CONTEXT_SELECT  + "=(" + 
> HTTP_WHITEBOARD_CONTEXT_NAME + '=' + ContextHelper.CTX_NAME + ')',
>               HTTP_WHITEBOARD_SERVLET_NAME    + '=' + "MyApp Listings",
>               HTTP_WHITEBOARD_SERVLET_PATTERN + '=' + "/list/*"
>        },
>        service   = Servlet.class,
>        immediate = true)
> @Designate(
>        ocd = AppConfig.class)
> public class Listings
>        implements HttpServlet
> {…}

Reply via email to