code: public void doGet(HttpServletRequest request, HttpServletResponse response) 
          throws ServletException, IOException
      {
          response.setContentType("text/html");
          response.setHeader("Pragma", "no-cache");
          response.setHeader("Cache-Control", "no-cache,no-store");
  
          String url=request.getParameter("URL");
          if (url!=null && url.length()>0)
          {
              response.sendRedirect(url);
          }
          else
          {
              PrintWriter pout = response.getWriter();
              Page page=null;
              
              try{
                  page = new Page();
                  page.title("SendRedirect Servlet");     
                  
                  page.add(new Heading(1,"SendRedirect Servlet"));
                  
                  page.add(new Heading(1,"Form to generate Dump content"));
                  TableForm tf = new TableForm
                      (response.encodeURL(URI.addPaths(request.getContextPath(),
                                                       request.getServletPath())+
                                          "/action"));
                  tf.method("GET");
                  tf.addTextField("URL","URL",40,request.getContextPath()+"/dump");
                  tf.addButton("Redirect","Redirect");
                  page.add(tf);
                  page.write(pout);
                  pout.close();
              }
              catch (Exception e)
              {
                  log.warn(LogSupport.EXCEPTION,e);
              }
          }
      }
docs: /* ------------------------------------------------------------