Examples of sendRedirect()


Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

                    ext = "";
                } else if(ext.length() > 0) {
                    ext = "." + ext;
                }
                final String path = request.getContextPath() + job.getPath() + ext;
                response.sendRedirect(path);
            } catch (org.apache.sling.api.resource.LoginException e) {
                throw new ServletException("LoginException in doFilter", e);
            }
        } else {
            chain.doFilter(sreq, sresp);
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        EasyMock.expect(mockRequest.getSession()).andReturn(internalSession).anyTimes();
       
        EasyMock.expect(mockResponse.encodeRedirectURL("http://localhost/loginpage")).andReturn("http://localhost/loginpage").atLeastOnce();
       
        try {
      mockResponse.sendRedirect("http://localhost/loginpage");
    } catch (IOException e) {
      fail(e.getMessage());
    }
        EasyMock.expectLastCall();
       
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        HttpServletRequest httpRequest = (HttpServletRequest) request;
        HttpServletResponse httpResponse = (HttpServletResponse) response;

        String redirectUrl = buildRedirectUrlToLoginPage(httpRequest,
                httpResponse, accessDeniedException);
        httpResponse.sendRedirect(httpResponse.encodeRedirectURL(redirectUrl));
    }

    protected String buildRedirectUrlToLoginPage(HttpServletRequest request,
            HttpServletResponse response, AccessDeniedException authException) {
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        HttpServletResponse response = ServletActionContext.getResponse();

        if (referer != null) {
            log.info("reload complete, reloading user back to: " + referer);
            saveMessage(getText("reload.succeeded"));
            response.sendRedirect(response.encodeRedirectURL(referer));
            return SUCCESS;
        } else {
            response.setContentType("text/html");

            PrintWriter out = response.getWriter();
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

    //Invalidate the session and send a redirect to index.html
    public void logout() throws IOException {
        HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false);
        session.invalidate();
        HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
        response.sendRedirect("index.html");
        facesContext.responseComplete();
    }
   
    //This method return the stack trace string from the Exception
    public String getStackTrace() {
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        if (admins.contains(uid)) {
            casUser.setAdmin(true);
        }
        httpServletRequest.getSession().setAttribute(POST_CAS_AUTHENTICATION_INFO, casUser);
        String uri = (String) httpServletRequest.getSession().getAttribute(REDIRECT_URL);
        httpResponse.sendRedirect(uri);
    }

    @Override
    public void destroy() {
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

            buf.append('?').append(queryString);
        }

        String returnURL = buf.toString();

        response.sendRedirect(redirectURI.addQueryData(returnKey, returnURL).render());
    }

    static class Status {
        private final TurbineRunData rundata;
        private       PetstoreUser   user;
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        HttpSession session = req.getSession(true);

        String pageRequested = req.getRequestURI().toString();
        if (session.getAttribute("userID") == null && !pageRequested.contains("login.xhtml") && !pageRequested.contains(".css") && !pageRequested.contains(".png")) {
            if(pageRequested.contains("faces"))
            resp.sendRedirect("login.xhtml");
            else
                resp.sendRedirect("faces/login.xhtml");
        } else {
            chain.doFilter(request, response);
        }
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        String pageRequested = req.getRequestURI().toString();
        if (session.getAttribute("userID") == null && !pageRequested.contains("login.xhtml") && !pageRequested.contains(".css") && !pageRequested.contains(".png")) {
            if(pageRequested.contains("faces"))
            resp.sendRedirect("login.xhtml");
            else
                resp.sendRedirect("faces/login.xhtml");
        } else {
            chain.doFilter(request, response);
        }
    }
View Full Code Here

Examples of javax.servlet.http.HttpServletResponse.sendRedirect()

        HttpSession session = req.getSession(true);

        String pageRequested = req.getRequestURI().toString();
        if (session.getAttribute("userID") == null && !pageRequested.contains("login.xhtml") && !pageRequested.contains(".css") && !pageRequested.contains(".png")) {
            if(pageRequested.contains("faces"))
            resp.sendRedirect("login.xhtml");
            else
                resp.sendRedirect("faces/login.xhtml");
        } else {
            chain.doFilter(request, response);
        }
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.