Hello,

I'm using Pax Web HTTP Service Extension to bundle a webapp into an
OSGi container. I'm able to register my servlets and other resources
without problems, but I can't find a way to set the context root of my
application.

What I would like to do is to first set the context root of my
application, and then register servlets and other resources with paths
relative to that root. What I have to do instead is to register
resources to a path that includes the context root.

For instance, I'm doing something like:

webContainer.registerServlet("/app_root/servlet_path", new
SomeServlet(), null, httpContext);

but would like to be doing something like:

webContainer.setContextRoot("/app_root");
webContainer.registerServlet("/servlet_path", new SomeServlet(), null,
httpContext);

The reason I would like to do this is that some of my servlets need to
access the correct context root. Of course, by using my workaround,
the context root is not correctly set to "app_root".

I've been searching for quite a while for a solution to my problem,
but just can't find any. Is it even possible with the HTTP Service
Extension?

Thanks,
Jonathan

_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general

Reply via email to