Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /* ZkAccessDeniedHandler.java
 
 {{IS_NOTE
 	Purpose:
 		
 	Description:
 		
 	History:
 		Thu Dec 21 16:45:26     2006, Created by Henri
}}IS_NOTE
Copyright (C) 2006 Potix Corporation. All Rights Reserved.
{{IS_RIGHT
}}IS_RIGHT
*/
package org.zkoss.zkplus.acegi;
Used by ExceptionTranslationFilter to handle an AccessDeniedException. This handler will popup the specified error page so it must be a Window that can be doModel.

Applicable to Acegi Security version 1.0.3

Deprecated:
As of release 7.0.0
Author(s):
Henri
public class ZkAccessDeniedHandler implements AccessDeniedHandler {
	private static final String ON_ACCESSDENIED = "onAccessDenied";
	private String _errorPage;
	public void setErrorPage(String url) {
		 = url;
	}
	public String getErrorPage() {
		return ;
	}
    public void handle(ServletRequest requestServletResponse responseAccessDeniedException accessDeniedException)
        throws IOExceptionServletException {
        // Put exception into request scope (perhaps of use to a view)
            accessDeniedException);
    	final Component comp = (Componentrequest.getAttribute(.);
		if (!comp.isListenerAvailable(true)) {
			final EventListener<Eventlistener = new ShowWindowEventListener<Event>();
			comp.setAttribute(listener);
		}
		final String url = getErrorPage();
    	Events.postEvent(new Event(compurl != null ? url : "~./accessDenied.zul"));
    }
New to GrepCode? Check out our FAQ X