Example usage for javax.servlet.http HttpServletRequest getRequestDispatcher

List of usage examples for javax.servlet.http HttpServletRequest getRequestDispatcher

Introduction

In this page you can find the example usage for javax.servlet.http HttpServletRequest getRequestDispatcher.

Prototype

public RequestDispatcher getRequestDispatcher(String path);

Source Link

Document

Returns a RequestDispatcher object that acts as a wrapper for the resource located at the given path.

Usage

From source file:com.netcracker.financeapp.controller.MainServlet.java

@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    int allMoney = bankCardService.getAllMoney();
    request.setAttribute("allMoney", allMoney);
    request.getRequestDispatcher("mainPage.jsp").forward(request, response);

}

From source file:com.pagoadalabs.fileupload.controller.FileController.java

/**
 * Handles the HTTP <code>GET</code> method.
 *
 * @param request servlet request/*w  ww  .j a  v a2s  . c o  m*/
 * @param response servlet response
 * @throws ServletException if a servlet-specific error occurs
 * @throws IOException if an I/O error occurs
 */
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    request.getRequestDispatcher("fileupload.jsp").forward(request, response);
}

From source file:tianci.pinao.dts.interceptor.LifeTimeInterceptor.java

@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
        throws Exception {
    if (checkLifeTime())
        return super.preHandle(request, response, handler);
    else {/*from ww w  .ja  v  a  2  s  .  c o  m*/
        request.getRequestDispatcher("/expire.html").forward(request, response);
        return false;
    }
}

From source file:net.thewaffleshop.nimbus.security.ForwardingAuthenticationHandler.java

@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
        AuthenticationException exception) throws IOException, ServletException {
    request.setAttribute("authenticationException", exception);
    request.getRequestDispatcher("/authenticationFailure").forward(request, response);
}

From source file:com.mockey.ui.InjectRealUrlPerServiceServlet.java

/**
 * //from   ww  w.  j  a  va 2s .  c o m
 * 
 * @param req
 *            basic request
 * @param resp
 *            basic resp
 * @throws ServletException
 *             basic
 * @throws IOException
 *             basic
 */
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    RequestDispatcher dispatch = req.getRequestDispatcher("/inject_realurl.jsp");
    dispatch.forward(req, resp);
}

From source file:edu.morgan.server.UploadFile.java

@Override
public void doGet(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, java.io.IOException {
    RequestDispatcher rd;// w w  w  . j av a 2s.  c om
    rd = request.getRequestDispatcher("fail.jsp");
    rd.forward(request, response);
}

From source file:com.taobao.diamond.server.controller.CheckServlet.java

public void forward(HttpServletRequest request, HttpServletResponse response, String page, String basePath,
        String postfix) throws IOException, ServletException {
    RequestDispatcher requestDispatcher = request.getRequestDispatcher(basePath + page + postfix);
    requestDispatcher.forward(request, response);
}

From source file:com.netcracker.financeapp.controller.type.TypeDeleteServlet.java

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    int deleted_id = typeService.deleteTypeByName(request.getParameter("typeListVal"));
    if (deleted_id > 0) {
        request.getRequestDispatcher("templates/success.jsp").forward(request, response);
    } else {//from   ww  w.  j  av  a  2 s.  c o m
        request.getRequestDispatcher("templates/error.jsp").forward(request, response);
    }
}

From source file:com.ibm.watson.ta.retail.DemoServlet.java

/**
 * Forward the request to the index.jsp file
 *
 * @param req/* w ww  .  j  av  a 2 s  . c om*/
 *            the Http Servlet request
 * @param resp
 *            the Http Servlet response
 * @throws ServletException
 *             the servlet exception
 * @throws IOException
 *             Signals that an I/O exception has occurred.
 */
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
    req.getRequestDispatcher("/index.jsp").forward(req, resp);
}

From source file:com.netcracker.financeapp.controller.agent.AgentDeleteServlet.java

@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
    int deleted_id = agentService.deleteAgentByName(request.getParameter("agentListVal"));
    if (deleted_id > 0) {
        request.getRequestDispatcher("templates/success.jsp").forward(request, response);
    } else {/*from w  w w.j ava2 s  .  c  om*/
        request.getRequestDispatcher("templates/error.jsp").forward(request, response);
    }
}