>>>>> Steinar Bang <[email protected]>: > Here is a working example:
One thing I forgot about the working example: - I need to have HTTP whiteboard loaded when I start the servlet components I accomplish this by adding a dependency to the pax-http-whiteboard feature in the template karaf feature files of the bundles holding the DS components that contain services that want to register with the HTTP whiteboad: https://github.com/steinarb/ukelonn/blob/8442f5df62bc973902085705c637e65c3bc00f8c/ukelonn.web.security/src/main/feature/feature.xml#L21 > 1. This defines the web context "/ukelonn" (and attaches a shiro filter > to the web context) > > https://github.com/steinarb/ukelonn/blob/8442f5df62bc973902085705c637e65c3bc00f8c/ukelonn.web.security/src/main/java/no/priv/bang/ukelonn/web/security/UkelonnServletContextHelper.java#L7 > > https://github.com/steinarb/ukelonn/blob/8442f5df62bc973902085705c637e65c3bc00f8c/ukelonn.web.security/src/main/java/no/priv/bang/ukelonn/web/security/UkelonnShiroFilter.java#L42 > 2. Here are servlets that register with the webcontext > > https://github.com/steinarb/ukelonn/blob/8442f5df62bc973902085705c637e65c3bc00f8c/ukelonn.web.services/src/main/java/no/priv/bang/ukelonn/api/UkelonnRestApiServlet.java#L37 > > https://github.com/steinarb/ukelonn/blob/8442f5df62bc973902085705c637e65c3bc00f8c/ukelonn.web.frontend/src/main/java/no/priv/bang/ukelonn/web/frontend/UkelonnServlet.java#L36 > The syntax for registering with the context ie. > HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_SELECT + "=(" + > HttpWhiteboardConstants.HTTP_WHITEBOARD_CONTEXT_NAME +"=ukelonn)", > is a bit clumsy, but it works. > (I have on my todo list to figure out if the servlet API 3.0 annotations > can be used instead...)
