public class JSPservlet extends HttpServlet {
  public static HashMap JSPhandlers = null;
  public static final synchronized JSPhandler
    getHandler(ServletConfig sc,
    String contextPath) throws ServletException {
    JSPhandler jh = null;
    if (JSPhandlers == null)
      JSPhandlers = new HashMap();
    else
      jh = (JSPhandler)JSPhandlers.get(
        contextPath);
    if (jh != null)
      return jh;
    jh = new JSPhandler(sc, contextPath);
    JSPhandlers.put(contextPath, jh);
    return jh;
  }
  public void service(HttpServletRequest request,
    HttpServletResponse response)
    throws ServletException, IOException {
    JSPhandler jh = getHandler(getServletConfig(),
      request.getContextPath());
    Servlet srv = jh.get(request.getPathInfo());
    srv.service(request, response);
  }
}