Model view controller Struts从模型重定向

Model view controller Struts从模型重定向,model-view-controller,jboss,struts,Model View Controller,Jboss,Struts,我试图实现一个安全模型,其中安全页面的模型继承自SecureSupport。但是,我不知道如何或者是否可以从构造函数重定向。见下文: public class SecureSupport extends ActionSupport { private Map session; public SecureSupport throws Exception { session = ActionContext.getContext().getSession()

我试图实现一个安全模型,其中安全页面的模型继承自SecureSupport。但是,我不知道如何或者是否可以从构造函数重定向。见下文:

public class SecureSupport extends ActionSupport {
    private Map session;

    public SecureSupport  throws Exception
    {
        session = ActionContext.getContext().getSession();

        if(!session.containsKey("User"))
        {
            // redirect from here
        }
        return SUCCESS;
    }
创建您自己的异常(即NoUserException),它必须是运行时异常。然后用全局异常处理程序捕获这个异常,在那里你可以重定向到任何你想要的地方