Package com.softwaremill.common.faces.navigation

Examples of com.softwaremill.common.faces.navigation.Page


    public void beforePhase(PhaseEvent event) {
        FacesContext ctx = event.getFacesContext();
        HttpSession session = ((HttpSession) ctx.getExternalContext().getSession(true));
        LoginBean login = BeanInject.lookup(LoginBean.class);
        Page page = nav.lookup(event.getFacesContext().getViewRoot().getViewId());

        if (page.isRequiresLogin() && !login.isLoggedIn()) {
            if (nav.shouldRedirectToLogin()) {
                redirectToLogin(ctx, session, nav, page);
            } else {
                nav.responseForbidden(ctx);
            }
        } else if (login.isLoggedIn() && session.getAttribute(PREVIOUS_VIEW) != null) {
            redirectToPreviousView(ctx, session);
        } else if (page.getSecurityEL() != null && page.getSecurityEL().length() > 0) {
            evaluateSecurityExpression(ctx, page);
        }
    }
View Full Code Here

TOP

Related Classes of com.softwaremill.common.faces.navigation.Page

Copyright © 2018 www.massapicom. 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.