How to redirect page in JSF Portlet application? - Websphere

This is a discussion on How to redirect page in JSF Portlet application? - Websphere ; Hi, I am using RAD7 and portal51. In my JSF Portlet application, for each page in preRender I just want to check if already login, if not, redirect to login.jsp, all my jsp pages are sitting directly under WebContent. The ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: How to redirect page in JSF Portlet application?

  1. How to redirect page in JSF Portlet application?


    Hi,

    I am using RAD7 and portal51.

    In my JSF Portlet application, for each page in preRender I just want to check if already login, if not, redirect to login.jsp, all my jsp pages are sitting directly under WebContent. The following is my check login coding:

    User user = (User)getSessionScope().get("user");
    if (user == null) {
    ExternalContext ec = FacesContext.getCurrentInstance().getExternalConte xt();
    try {
    ec.redirect("login.jsp");
    } catch (Exception e) {
    }
    }

    However it just does not redirect. Should I add context path before login.jsp?

    Any idea?

    Thanks very much in advance!


  2. Re: How to redirect page in JSF Portlet application?

    Hi,



    You may want to consider using a custom navigation handler.



    Check out these two links on some advice on how to implement them.



    http://www.jsftutorials.net/jsfNavig...-redirect.html



    http://www.jsftutorials.net/faces-co...Decorator.html


    Hope this helps.

    Message was edited by: charlie88

+ Reply to Thread