How to make a redirection on page load in JSF 1.x

后端 未结 5 1656
谎友^
谎友^ 2020-12-02 08:18

I have a web-application where the users can be sent directly to some specific pages (such as a page where he can view or edit an item). To achieve that, we provide a specif

5条回答
  •  执笔经年
    2020-12-02 09:09

    you should use action instead of actionListener:

    
    

    and in close method you right something like:

    public String close() {
       return "index?faces-redirect=true";
    }
    

    where index is one of your pages(index.xhtml)

    Of course, all this staff should be written in our original page, not in the intermediate. And inside the close() method you can use the parameters to dynamically choose where to redirect.

提交回复
热议问题