Package javax.servlet.http

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


                if (articles.needViewPwd(httpServletRequest, article)) {
                    article = articleRepository.get(articleId); // Loads the article entity

                    final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
                    try {
                        httpServletResponse.sendRedirect(Latkes.getServePath()
                                                         + "/console/article-pwd" + articles.buildArticleViewPwdFormParameters(article));
                        return;
                    } catch (final Exception e) {
                        httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
                        return;
View Full Code Here


        // If requests an article and the article need view passowrd, sends redirect to the password form
        final ArticleQueryService articleQueryService = beanManager.getReference(ArticleQueryService.class);

        if (null != article && articleQueryService.needViewPwd(httpServletRequest, article)) {
            try {
                httpServletResponse.sendRedirect(
                    Latkes.getServePath() + "/console/article-pwd?articleId=" + article.optString(Keys.OBJECT_ID));
                return;
            } catch (final Exception e) {
                httpServletResponse.sendError(HttpServletResponse.SC_NOT_FOUND);
                return;
View Full Code Here

        final HttpServletResponse response = context.getResponse();

        userMgmtService.tryLogInWithCookie(request, response);

        if (null != userService.getCurrentUser(request)) { // User has already logged in
            response.sendRedirect(destinationURL);

            return;
        }

        renderPage(context, "login.ftl", destinationURL, request);
View Full Code Here

            // no validation errors
            if (featureModel.isValid()) {

                FeatureState state = featureModel.toFeatureState();
                featureManager.setFeatureState(state);
                response.sendRedirect("index");

            }

            // got validation errors
            else {
View Full Code Here

        String defaultPortal = configService.getDefaultPortal();
        PortalURLContext urlContext = new PortalURLContext(context, SiteKey.portal(defaultPortal));
        NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);
        String s = url.setResource(new NavigationResource(SiteType.PORTAL, defaultPortal, "")).toString();
        HttpServletResponse resp = context.getResponse();
        resp.sendRedirect(resp.encodeRedirectURL(s));
        return true;
    }

    @Override
    protected boolean getRequiresLifeCycle() {
View Full Code Here

        } else {
            requestLocale = I18N.parseTagIdentifier(lang);
        }

        if (requestSiteName == null) {
            res.sendRedirect(req.getContextPath());
            return true;
        }

        PortalApplication app = controllerContext.getController().getApplication(PortalApplication.PORTAL_APPLICATION_ID);
        PortalRequestContext context = new PortalRequestContext(app, controllerContext, requestSiteType, requestSiteName,
View Full Code Here

        HttpServletRequest request = context.getRequest();
        HttpServletResponse response = context.getResponse();

        if (requestURI.startsWith(request.getContextPath() + "/private/") && request.getRemoteUser() == null) {
            String doLoginPath = request.getContextPath() + "/login" + "?initialURI=" + request.getRequestURI();
            response.sendRedirect(response.encodeRedirectURL(doLoginPath));
            return true;
        }

        SiteKey siteKey = SiteKey.portal(requestSiteName);
        String uri = requestPath;
View Full Code Here

            url.setQueryParameterValues(parameter, request.getParameterValues(parameter));
        }

        String s = url.toString();

        response.sendRedirect(response.encodeRedirectURL(s));
        return true;
    }

    @Override
    protected boolean getRequiresLifeCycle() {
View Full Code Here

                session = AccessController.doPrivileged(new HttpSessionImpl.UnwrapSessionAction(httpSession));
            }
            String path = (String) session.getAttribute(SESSION_KEY);
            if (path != null) {
                try {
                    resp.sendRedirect(path);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }
View Full Code Here

                String[] pi = rc.getPathInfo();
                int len = pi.length - Integer.parseInt(sub);
                StringBuilder buffer = new StringBuilder().append(request.getContextPath());
                for(int i=0; i<len; i++)
                    buffer.append('/').append(pi[i]);
                response.sendRedirect(buffer.toString());
                return;
            }
            request.setAttribute(Constants.MSG, Feedback.USER_UPDATED.getMsg());
        }
        else
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.