0

best way to interrupt the page create

asked 2018-11-27 11:10:14 +0800

superium gravatar image superium
17 2

i would like to interrupt the page create if user not logged in,but ...

public class Authentication implements Initiator,InitiatorExt {
    private final Logger logger = Logger.getLogger(Authentication.class);

    @Override
    public void doInit(Page page, Map<String, Object> args) throws Exception {
        if (....) {
            Executions.sendRedirect("/login.zul");
            throw new Exception("not authenticated!");  //without this, the page will be created before redirect to login.zul.
                                    //with this, the console and client got an "not authenticated!" Exception .
        }
    }

    @Override
    public boolean doCatch(Throwable ex) throws Exception {

        return false;
    }

    ....
}
delete flag offensive retag edit
Be the first one to answer this question!
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2018-11-27 11:10:14 +0800

Seen: 2 times

Last updated: Nov 27

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More