felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Derek Baum (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-5319) HttpServiceRuntime provides incorrect info for service that is both Servlet and Resource
Date Fri, 05 Aug 2016 15:49:20 GMT

    [ https://issues.apache.org/jira/browse/FELIX-5319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15409596#comment-15409596
] 

Derek Baum commented on FELIX-5319:
-----------------------------------

Hi Carsten,

Thanks for fixing this so quickly.

I can confirm that a local build of 3.2.3-SNAPSHOT works fine for me.

--
Derek

> HttpServiceRuntime provides incorrect info for service that is both Servlet and Resource
> ----------------------------------------------------------------------------------------
>
>                 Key: FELIX-5319
>                 URL: https://issues.apache.org/jira/browse/FELIX-5319
>             Project: Felix
>          Issue Type: Bug
>          Components: HTTP Service
>    Affects Versions: http.base-3.0.10, http.jetty-3.2.2, http.bridge-3.0.10
>            Reporter: Derek Baum
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: http.base-3.0.12, http.jetty-3.2.4, http.bridge-3.0.12
>
>
> I have a servlet defined as follows:
> Note: it defines _both_ servlet and resource properties.
> @Component(property = {
> 		HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_NAME + "=Hello World",
> 		HttpWhiteboardConstants.HTTP_WHITEBOARD_SERVLET_PATTERN + "=/hello/sayHello",
>         HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + "=/hello/static/*",
>         HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PREFIX + "=/static"
>         })
> public class HelloWorldServlet extends HttpServlet implements Servlet {
> }
> I am using the HttpServiceRuntime to discover servlet info, but this servlet does not
appear.
> @Reference
> HttpServiceRuntime httpRuntime;
> RuntimeDTO runtimeDTO = httpRuntime.getRuntimeDTO();
> for (ServletContextDTO servletContextDTO : runtimeDTO.servletContextDTOs) {
> 	ServletDTO[] servletDTOs = servletContextDTO.servletDTOs;
>     // servletDTOs.length == 0
> }
> The equivalent code for ResourceDTO _does_ find a ResourceDTO for this servlet, but it
contains servlet, rather than resource info:
> resourceDTO.patterns = [/hello/sayHello]
> resourceDTO.prefix = null
> If I remove this resource property from the servlet, then the above code finds the servlet,
as expected:
> HttpWhiteboardConstants.HTTP_WHITEBOARD_RESOURCE_PATTERN + "=/hello/static/*"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message