List of usage examples for javax.servlet.http HttpServletRequest getRequestDispatcher
public RequestDispatcher getRequestDispatcher(String path);
From source file:ModuleServlet.java
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { response.setContentType("text/html"); java.io.PrintWriter out = response.getWriter(); out.println("<html><head>"); RequestDispatcher dispatcher = request.getRequestDispatcher("/WEB-INF/functions.js"); dispatcher.include(request, response); out.println("<title>Client Forms</title></head><body>"); out.println("<h2>Enter Your Name and Email</h2>"); out.println(/* w ww. j a v a 2 s . c om*/ "<form action=\"/home/displayHeaders.jsp\" name=\"entryForm\" onSubmit=\" return CheckEmail(this.email.value)\">"); out.println("<table border=\"0\"><tr><td valign=\"top\">"); out.println( "First and last name: </td> <td valign=\"top\"><input type=\"text\" name=\"name\" size=\"20\"></td></tr>"); out.println("<tr><td valign=\"top\">"); out.println("Email: </td> <td valign=\"top\"><input type=\"text\" name=\"email\" size=\"20\"></td>"); out.println("<tr><td valign=\"top\"><input type=\"submit\" value=\"Submit\" ></td>"); out.println("</tr></table></form>"); out.println("</body></html>"); }
From source file:Controllers.AddItem.java
/** * Handles the HTTP <code>GET</code> method. * * @param request servlet request/*from www . ja v a2 s . 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 { ArrayList<Category> categories = ItemRepository.getCategories(); request.setAttribute("categories", categories); request.getRequestDispatcher("dashboard/addItem.jsp").forward(request, response); }
From source file:com.netcracker.financeapp.controller.agent.AgentAddServlet.java
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String agentNumber = request.getParameter("agentNumber"); String agentName = request.getParameter("agentName"); int agentId = agentService.insertSpendingType(agentName, agentNumber); if (agentId > 0) { request.getRequestDispatcher("templates/success.jsp").forward(request, response); } else {//from ww w .java2 s. c om request.getRequestDispatcher("templates/error.jsp").forward(request, response); } }
From source file:info.magnolia.cms.servlets.EntryServlet.java
/** * Attach Interceptor servlet if interception needed * @param request HttpServletRequest//w w w . ja v a2 s. c om * @param response HttpServletResponse */ private void intercept(HttpServletRequest request, HttpServletResponse response) { if (request.getParameter(INTERCEPT) != null) { try { request.getRequestDispatcher(REQUEST_INTERCEPTOR).include(request, response); } catch (Exception e) { log.error("Failed to Intercept"); //$NON-NLS-1$ log.error(e.getMessage(), e); } } }
From source file:com.parallax.server.blocklyprop.servlets.ConfirmRequestServlet.java
public void showTextilePage(HttpServletRequest req, HttpServletResponse resp, ConfirmPage confirmPage) throws ServletException, IOException { String html = textileFileReader.readFile("confirm/" + confirmPage.getPage(), ServletUtils.getLocale(req), req.isSecure());//from w ww. ja v a 2s. c o m req.setAttribute("html", html); req.getRequestDispatcher("/WEB-INF/servlet/html.jsp").forward(req, resp); }
From source file:controller.ProductProcess.java
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int id = Integer.parseInt(request.getParameter("idWatch")); Watch watch = watchDAO.getWatchById(id); watchDAO.deleteWatch(watch);/*from w ww . j a v a 2 s.c o m*/ request.getRequestDispatcher("admin-product.jsp").forward(request, response); }
From source file:com.netcracker.financeapp.controller.type.TypeDeleteServlet.java
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ArrayList<String> typeList = typeService.getIncomeTypeNames(); typeList.addAll(typeService.getSpendingTypeNames()); request.setAttribute("typeList", typeList); request.setAttribute("clearType", "Select Type"); request.getRequestDispatcher("type/typeDelete.jsp").forward(request, response); }
From source file:com.litemvc.LiteMvcFilter.java
public void processTemplate(HttpServletRequest request, HttpServletResponse response, String templateName, Object handler) {/*from w w w.jav a 2s . c om*/ try { request.getRequestDispatcher(templateName).include(request, response); } catch (Exception e) { throw new RuntimeException(e.getMessage(), e); } }
From source file:dk.dma.msiproxy.web.MessageDetailsServlet.java
/** * Generates a HTML page containing the MSI message details * @param request the HTTP servlet request * @param response the HTTP servlet response */// ww w . j av a 2s . c o m private void generateHtmlPage(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // Normal processing request.getRequestDispatcher(DETAILS_JSP_FILE).include(request, response); response.flushBuffer(); }
From source file:com.bxf.hradmin.security.AccessDeniedHandler.java
@Override public void handle(HttpServletRequest request, HttpServletResponse response, AccessDeniedException accessDeniedException) throws IOException, ServletException { request.setAttribute("defaultRedirectUrl", defaultRedirectUrl); request.setAttribute("timeToRedirect", timeToRedirect); RequestDispatcher dispatcher = request.getRequestDispatcher(errorPage); dispatcher.forward(request, response); return;//from www . j av a2s. c o m }