org.zkoss.spring.security.ui
Class ZkAccessDeniedHandler

java.lang.Object
  extended by org.zkoss.spring.security.ui.ZkAccessDeniedHandler
All Implemented Interfaces:
org.springframework.security.web.access.AccessDeniedHandler

public class ZkAccessDeniedHandler
extends java.lang.Object
implements org.springframework.security.web.access.AccessDeniedHandler

This implementation pop up an error window and show the provided error page or code 403

Since:
1.0
Author:
henrichen

Field Summary
static java.lang.String ERROR_403_URL
           
 
Constructor Summary
ZkAccessDeniedHandler()
           
 
Method Summary
 java.lang.String getErrorTemplate()
          Returns the error template URL.
 java.util.Map getErrorTemplateArgs()
          Return the error template window arguments Map.
 void handle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.access.AccessDeniedException accessDeniedException)
           
 void removeErrorTemplateArg(java.lang.String param)
          Remove the specified error template parameter.
 void setErrorTemplate(java.lang.String templateURL)
          Set the error template URL.
 void setErrorTemplateArg(java.lang.String param, java.lang.Object value)
          The argument to be passed into the error window template (see getErrorTemplate()).
 void setErrorTemplateArgs(java.util.Map map)
          Sets the error template window arguments Map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR_403_URL

public static final java.lang.String ERROR_403_URL
See Also:
Constant Field Values
Constructor Detail

ZkAccessDeniedHandler

public ZkAccessDeniedHandler()
Method Detail

handle

public void handle(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response,
                   org.springframework.security.access.AccessDeniedException accessDeniedException)
            throws java.io.IOException,
                   javax.servlet.ServletException
Specified by:
handle in interface org.springframework.security.web.access.AccessDeniedHandler
Throws:
java.io.IOException
javax.servlet.ServletException

setErrorTemplateArg

public void setErrorTemplateArg(java.lang.String param,
                                java.lang.Object value)

The argument to be passed into the error window template (see getErrorTemplate()). If you did not specify own error window template, the system use the default one.

In error window template, you can customize it by passing arguments into it via this method. And you refer the parameter by specifying in the template window in EL with ${arg.xxx} or in <zscript> with arg.xxx.

If you don't specify your own error window template, you can still customize the default login window template by assign values to following parameters.

Parameters:
param - the parameter key to be passed into login template.
value - the parameter value to be passed into login template.

removeErrorTemplateArg

public void removeErrorTemplateArg(java.lang.String param)
Remove the specified error template parameter.

Parameters:
param - the error template parameter to be removed.

setErrorTemplateArgs

public void setErrorTemplateArgs(java.util.Map map)
Sets the error template window arguments Map.

Parameters:
map - the error template window arguments Map.

getErrorTemplateArgs

public java.util.Map getErrorTemplateArgs()
Return the error template window arguments Map.

Returns:
the error template window arguments Map.

setErrorTemplate

public void setErrorTemplate(java.lang.String templateURL)
Set the error template URL. This must be a zul page. This implementation will simply call Executions.createComponents(getErrorTemplate(), null, getErrorTemplateArgs()) .If you did not specify a template URL, the default template URL is used.

Parameters:
templateURL - the template URL

getErrorTemplate

public java.lang.String getErrorTemplate()
Returns the error template URL.

Returns:
the error template URL.

paramtypememo
titleStringLogin Window Title
widthStringwindow width
heightStringwindow height

Copyright © 2005-2007 Potix Corporation. All Rights Reserved.