org.zkoss.zk.ui.util
Interface URIInterceptor


public interface URIInterceptor

Used to intercept the loading of ZUML pages associated with the specfied URI. Developers usually use it to do the security check.

How this interface is used.

  1. First, you specify a class that implements this interface in WEB-INF/zk.xml as a listener. Then, an instance of the specified class is created.
  2. Each time ZK wants to load a page definition based on an URI, request(java.lang.String) is called against the instance created in the previous step.

Note:

Differences to RequestInterceptor

URIInterceptor is called when retrieving a page definition from an URI (PageDefinitions.getPageDefinition(org.zkoss.zk.ui.WebApp, org.zkoss.util.resource.Locator, java.lang.String)). It may or may not be caused by a client request. On the other hand, RequestInterceptor is called when ZK Loader or ZK Update Engine is receiving a client request.

Author:
tomyeh
See Also:
RequestInterceptor

Method Summary
 void request(java.lang.String uri)
          Called when the current user requests to load the page of the specified URI.
 

Method Detail

request

void request(java.lang.String uri)
             throws java.lang.Exception
Called when the current user requests to load the page of the specified URI.

To deny the access, the class shall throw an exception. If you want to redirect to another page, you can configure it with <error-page> by speciying the corresponding page and exception in WEB-INF/zk.xml.

Throws:
java.lang.Exception


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo