Resource loading with HttpService [message #553322] |
Tue, 17 August 2010 03:41  |
Eclipse User |
|
|
|
Hi,
I am using HttpService to embbed a WebServer into Eclipse. But I am facing some issue when trying to read resources by using ServletContext#getResource.
I have following setup:
0. internal bundle structure
+ Root
+--+ bin
+--+ META-INF
+--+ resources
+--+ WebContent
+-- index.html
1. bundle classpath
Bundle-ClassPath: ./bin, ./resources
2. register resource
httpService.registerResource("/", "/WebContent", myHttpContext);
I want to get load resources by calling:
servletContext.getResource("/index.html");
which returns null.
Instead I need to call the following to get the InputStream:
servletContext.getResource("/WebContent/index.html");
I expect the first one to work since I explicitly set the ressource mapping for alias "/" to "/WebContent". When I use ServletContext#getResource in plain WAR-enviroments like Tomcat this is working. So I am wondering whether there is any difference or whether I am missing something.
Thanks,
Bob
Do I miss something?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04943 seconds