Package javax.servlet

Examples of javax.servlet.RequestDispatcher.forward()


        if (dispatcher == null) {
            throw new ServletException(
                    "Cannot get a RequestDispatcher for path: "
                            + defaultResource);
        }
        dispatcher.forward(request, response);
    }
}
View Full Code Here


                RequestWrapper requestWrapper = new RequestWrapper(request,
                        operation.getHttpMethod());

                // if this is the last operation just forward the request
                if (!i.hasNext()) {
                    dispatcher.forward(requestWrapper, response);
                    break;
                }

                // wrap our response in order to capture its body
                ResponseWrapper responseWrapper = new ResponseWrapper(response);
View Full Code Here

    String key = request.getParameter("key");
    UserEntity user = getDao().getUserDao().getByKey(key);
    if (user == null || user.isDisabled()) {
      RequestDispatcher dispatcher = getServletContext()
          .getRequestDispatcher("/forgotPasswordFail.vm");
      dispatcher.forward(request,response);
    }
    else {
      user.setForgotPasswordKey(null);
      getDao().getUserDao().save(user);
      HttpSession session = request.getSession(true);
View Full Code Here

        throw new IllegalArgumentException("Missing header: " + SERVLET_HEADER);
      RequestDispatcher requestDispatcher = getServletContext().getNamedDispatcher(servlet);
      if (requestDispatcher == null)
        throw new IllegalStateException("Could not found servlet with name " + servlet);
      request.getSession().setHandler(servlet);
      requestDispatcher.forward(request, null);
    }   
    catch (Throwable e)
    {
      sendError(request, e);
    }
View Full Code Here

    // 执行 Forward
    RequestDispatcher rd = req.getRequestDispatcher(path);
    if (rd == null)
      throw Lang.makeThrow("Fail to find Forward '%s'", path);
    // Do rendering
    rd.forward(req, resp);
  }

  /**
   * 子类可以覆盖这个方法,给出自己特殊的后缀
   *
 
View Full Code Here

      if (rd == null)
        throw new FacesException(L.l("'{0}' is an unknown dispatcher.",
                                     path));

     
      rd.forward(_request, _response);
    } catch (ServletException e) {
      throw new FacesException(e);
    }
  }
View Full Code Here

      log.warning(L.l("FormLogin: session has timed out for session '{0}'",
                      req.getSession().getId()));
     
      RequestDispatcher disp = request.getRequestDispatcher("/");
      if (disp != null) {
        disp.forward(request, response);
        return;
      }
      else {
        throw new ServletException(L.l("Session has timed out for form authentication, no forwarding URI is available.  Either the login form must specify j_uri or the session must have a saved URI."));
      }
View Full Code Here

     
      // force authorization of the page because the normal forward()
      // bypasses authorization
      RequestDispatcher disp = newApp.getLoginDispatcher(suffix);
      if (disp != null) {
        disp.forward(req, res);
        return;
      }
    }
   
    res.sendRedirect(res.encodeRedirectURL(uri));
View Full Code Here

      disp = webApp.getNamedDispatcher("j_security_check");

      if (disp == null)
        throw new ServletException(L.l("j_security_check servlet must be defined to use form-based login."));

      disp.forward(request, response);
      return;
    }
  }

  /**
 
View Full Code Here

        response.setHeader("Cache-Control", "no-cache");
        response.setDateHeader("Expires", 0);
      }

      RequestDispatcher disp = webApp.getRequestDispatcher(_errorPage);
      disp.forward(request, response);
      return;
    }
    else if (uri.equals(_loginPage) || uri.equals(_errorPage)) {
      request.getRequestDispatcher(path).forward(request, response);
      return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.