>>>>> Александр <[email protected]>:
> Pax Web parses @WebServlet and @WebFilter annotations, but a little buggy
> (ignore "name" property of @WebServlet, so if you need a filter on it, use
> whiteboard constant for it).
> In your case, to declare multiple values for property just add two
> properties with same key:
> @Component(
> property= {"osgi.http.whiteboard.servlet.pattern=/ukelonn /*",
> "osgi.http.whiteboard.servlet.pattern=/VAADIN /*"},
> service=Servlet.class
> )
> or with constans of OSGI Annotations:
> @Component(
> property= { HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/
> ukelonn /*",
> HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/VAADIN /*"},
> service=Servlet.class
> )
Thanks! This worked:
@Component(
property= {
HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/ukelonn/*",
HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN+"=/VAADIN/*",
HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME+"=ukelonn"},
service=Servlet.class,
immediate=true
)
(the "immediate=true" is to emulate the behaviour of the BundleActivator
I'm replacing. I'll try lazy init once I get things up and working)
> For webfilter do not
> use HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_SERVLET
> ("osgi.http.whiteboard.filter.servlet") because of bug (pax web ignore it)
> use "servletNames" service property for workaround, or @WebFilter
> annotation with specified "servletNames" property.
Ah! I did not see this the first time around. I used
HttpWhiteboardConstants.HTTP_WHITEBOARD_FILTER_SERVLET and this seemed
to work, but it was kind of fragile (it stopped working when I changed
the class name of the filter).
I'll try "servletNames" in "property" in @Component instead, and see if
that helps.
Thanks again!
--
--
------------------
OPS4J - http://www.ops4j.org - [email protected]
---
You received this message because you are subscribed to the Google Groups
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.