String path = req.getServletPath(); if (  path == null || "/".equals(path) ) path = "index.html";
initContext(req, context);  String path = getPath(req);  if ( Velocity.resourceExists(path) ) { return getTemplate(path); }
    public Template handleRequest(HttpServletRequest req,                                   HttpServletResponse resp,                                  Context context)                           throws java.lang.Exception    {        String path = req.getServletPath();        if (  path == null || "/".equals(path) )            path = "index.html";                InputStream inStream = servletContext.getResourceAsStream(path);        if ( inStream != null ) {            LOG.fine("Evaluating template "+path+" for servletPath "+req.getServletPath());            Velocity.evaluate(context, resp.getWriter(), path, new InputStreamReader(inStream));        } else {            LOG.warning("Velocity: Can't load '"+path+"' for request "+                        req.getRequestURL().append("?").append(req.getQueryString()) );                                    resp.sendError(resp.SC_NOT_FOUND, path+" not found");        }                return null;    }