Package javax.servlet.http

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


        try {
            if (path.startsWith("/")) {
                path = request.getContextPath() + path;
            }

            response.sendRedirect(response.encodeRedirectURL(path));
        } catch (Exception e) {
            TagUtils.getInstance().saveException(pageContext, e);
            throw new JspException(messages.getMessage("forward.redirect",
                    name, e.toString()));
        }
View Full Code Here


        throws JspException {
        HttpServletResponse response =
            (HttpServletResponse) pageContext.getResponse();

        try {
            response.sendRedirect(url);
        } catch (IOException e) {
            TagUtils.getInstance().saveException(pageContext, e);
            throw new JspException(e.getMessage());
        }
    }
View Full Code Here

        try
        {
          // send redirect - this will discard POST parameters if the request is POST
          // - still better than getting an error because of lacking trailing slash
          httpServletResponse.sendRedirect(httpServletResponse.encodeRedirectURL(redirectURL));
        }
        catch (IOException e)
        {
          throw new RuntimeException(e);
        }
View Full Code Here

      HttpServletRequest hreq = (HttpServletRequest) request;
      HttpServletResponse hres = (HttpServletResponse) response;
      HttpSession session = hreq.getSession();

      if (session.isNew() && !hreq.getRequestURI().contains("newpages/Main.jsf")) {
         hres.sendRedirect(hreq.getContextPath());
         return;
      }

      //deliver request to next filter
      chain.doFilter(request, response);
View Full Code Here

        URL url = null;
        try {
            url = new URL(protocol, host, redirectPort, file.toString());
            if (debug >= 2)
                log("  Redirecting to " + url.toString());
            hresponse.sendRedirect(url.toString());
            return (false);
        } catch (MalformedURLException e) {
            if (debug >= 2)
                log("  Cannot create new URL", e);
            hresponse.sendError
View Full Code Here

            if (debug >= 1)
                log("Save request in session '" + session.getId() + "'");
            saveRequest(request, session);
            if (debug >= 1)
                log("Redirect to login page '" + loginURI + "'");
            hres.sendRedirect(hres.encodeRedirectURL(loginURI));
            return (false);
        }

        // Yes -- Validate the specified credentials and redirect
        // to the error page if they are not correct
View Full Code Here

            log("Authenticating username '" + username + "'");
        principal = realm.authenticate(username, password);
        if (principal == null) {
            if (debug >= 1)
                log("Redirect to error page '" + errorURI + "'");
            hres.sendRedirect(hres.encodeRedirectURL(errorURI));
            return (false);
        }

        // Save the authenticated Principal in our session
        if (debug >= 1)
View Full Code Here

            log("Redirecting to original '" + requestURI + "'");
        if (requestURI == null)
            hres.sendError(HttpServletResponse.SC_BAD_REQUEST,
                           sm.getString("authenticator.formlogin"));
        else
            hres.sendRedirect(hres.encodeRedirectURL(requestURI));
        return (false);

    }

View Full Code Here

    if (url != null && url.length() > 0) {
      FacesContext facesContext = FacesContext.getCurrentInstance();
      if (!facesContext.getResponseComplete()) {
        HttpServletResponse response = (HttpServletResponse) facesContext.getExternalContext().getResponse();
        try {
          response.sendRedirect(url);
        } catch (IOException e) {
          Helper.setFehlerMeldung("IOException: " + e.getMessage());
        }
        facesContext.responseComplete();
      }
View Full Code Here

          String fileName = myProzess.getTitel() + ".pdf";
          ServletContext servletContext = (ServletContext) context.getExternalContext().getContext();
          String contentType = servletContext.getMimeType(fileName);
          response.setContentType(contentType);
          response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
          response.sendRedirect(goobiContentServerUrl.toString());
          context.responseComplete();
        }
        if (metsTempFile.toURI().toURL() != null) {
          File tempMets = new File(metsTempFile.toURI().toURL().toString());
          tempMets.delete();
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.