Eclipse Platform
Release 3.3

org.eclipse.equinox.jsp.jasper
Class JspServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.eclipse.equinox.jsp.jasper.JspServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class JspServlet
extends javax.servlet.http.HttpServlet

JSPServlet wraps the Apache Jasper Servlet making it appropriate for running in an OSGi environment under the Http Service. The Jasper JSPServlet makes use of the Thread Context Classloader to support compile and runtime of JSPs and to accommodate running in an OSGi environment, a Bundle is used to provide the similar context normally provided by the webapp.

The Jasper Servlet will search the ServletContext to find JSPs, tag library descriptors, and additional information in the web.xml as per the JSP 2.0 specification. In addition to the ServletContext this implementation will search the bundle (but not attached fragments) for matching resources in a manner consistent with the Http Service's notion of a resource. By using alias and bundleResourcePath the JSP lookup should be in line with the resource mapping specified in {102.4} of the OSGi HttpService.

TLD discovery is slightly different, to clarify it occurs in one of three ways:

  1. declarations found in /WEB-INF/web.xml (found either on the bundleResourcePath in the bundle or in the ServletContext)
  2. tld files found under /WEB-INF (found either on the bundleResourcePath in the bundle or in the ServletContext)
  3. tld files found in jars on the Bundle-Classpath (see org.eclipse.equinox.internal.jsp.jasper.JSPClassLoader)

Other than the setting and resetting of the thread context classloader and additional resource lookups in the bundle the JSPServlet is behaviourally consistent with the JSP 2.0 specification and regular Jasper operation.

See Also:
Serialized Form

Constructor Summary
JspServlet(Bundle bundle, String bundleResourcePath)
           
JspServlet(Bundle bundle, String bundleResourcePath, String alias)
           
 
Method Summary
 void destroy()
           
 javax.servlet.ServletConfig getServletConfig()
           
 String getServletInfo()
           
 void init(javax.servlet.ServletConfig config)
           
 void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JspServlet

public JspServlet(Bundle bundle,
                  String bundleResourcePath,
                  String alias)

JspServlet

public JspServlet(Bundle bundle,
                  String bundleResourcePath)
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

destroy

public void destroy()

service

public void service(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
             throws javax.servlet.ServletException,
                    IOException
Throws:
javax.servlet.ServletException
IOException

getServletConfig

public javax.servlet.ServletConfig getServletConfig()

getServletInfo

public String getServletInfo()

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.