code: public void doGet(HttpServletRequest sreq, HttpServletResponse sres) 
          throws ServletException, IOException
      {
          String path = (String)
              sreq.getAttribute("javax.servlet.include.servlet_path");
          if (path==null)
              path=sreq.getServletPath();
          if (path.length()==0)
          {
              path=(String)sreq.getAttribute("javax.servlet.include.path_info");
              if (path==null)
                  path=sreq.getPathInfo();
          }
  
          String forward=(String)_forwardMap.get(path);
          if(log.isDebugEnabled())log.debug("Forward "+path+" to "+forward);
          if (forward!=null)
          {            
              ServletContext context =
                  getServletContext().getContext(forward);
              String contextPath=sreq.getContextPath();
              if (contextPath.length()>1)
                  forward=forward.substring(contextPath.length());
              
              RequestDispatcher dispatch =
                  context.getRequestDispatcher(forward);
              if (dispatch!=null)
              {
                  dispatch.forward(sreq,sres);
                  return;
              }
          }
  
          sres.sendError(404);
      }
docs: /* ------------------------------------------------------------