Hello
In Pax Web before 8, org.ops4j.pax.web.jsp.JspServletWrapper wraps original org.apache.jasper.servlet.JspServlet - the reasons are: special org.ops4j.pax.web.jsp.JasperClassLoader to scan bundles (this is done much better and more consistently in Pax Web 8) and special handling of "jsp files" (these are handled in standard way in Pax Web 8).
In Pax Web 8, org.ops4j.pax.web.jsp.JspServlet extends org.apache.jasper.servlet.JspServlet - the main (only) reason is that TCCL is set to proper OSGi classloader around init() and service() calls.
org.apache.jasper.servlet.JspServletWrapper is repackaged both in Pax Web 8 and Pax Web 7 - this is simply because pax-web-jsp bundle adds `org.apache.jasper.servlet` as exported package without import.
Generally JSP handling was a bit tricky (both in Pax Web 7 and 8) because there was a conflict between modular OSGi philosophy and JavaEE consistency (taglib scanning for example).
If you want to instantiate "jsp servlet" it's better to do it with org.ops4j.pax.web.jsp.JspServlet class from pax-web-jsp. However - for WABs/WARs, this servlet is instantiated automatically if pax-web-jsp bundle is installed and your JSPs will just work.
For HttpService / Whiteboard approach, you can use these examples/snippets:
HttpService:
org.ops4j.pax.web.service.WebContainer service = ...; // obtain OSGi service of org.ops4j.pax.web.service.WebContainer class (org.osgi.service.http.HttpService extension)
wc.registerJsps(new String[] { "*.jsp", "*.JSP", ... }, null, null);
Whiteboard:
org.ops4j.pax.web.extender.whiteboard.runtime.DefaultJspMapping mapping = new org.ops4j.pax.web.extender.whiteboard.runtime.DefaultJspMapping();
mapping.setUrlPatterns(new String[] { "*.jsp", "*.JSP", ... });
ServiceReference<org.ops4j.pax.web.service.whiteboard.JspMapping> ref = context.registerService(org.ops4j.pax.web.service.whiteboard.JspMapping.class, mapping, null);
org.ops4j.pax.web.extender.whiteboard.runtime.DefaultJspMapping Whiteboard service has setJspFile() setter that could be used to implement "jsp files" in the meaning of web.xml's:
<!--
This servlet doesn't have a class, only a JSP file. It'll be converted to use real JSP servlet with jspFile init parameter
-->
<servlet>
<servlet-name>jsp-info</servlet-name>
<jsp-file>/jsp-info.jsp</jsp-file>
</servlet>