Class InaccessibleWidgetBlockService
- java.lang.Object
-
- org.zkoss.zkmax.au.InaccessibleWidgetBlockService
-
- All Implemented Interfaces:
java.io.Serializable,org.zkoss.zk.au.AuService
public class InaccessibleWidgetBlockService extends java.lang.Object implements org.zkoss.zk.au.AuService, java.io.SerializableInaccessible Widget Block Service (IWBS) used to block the request sent by an inaccessible widget (at the client).Available in ZK EE
IWBS is designed to protect your application from attack. For example, an invisible button is easy to access by using, say, Firebug.
To register this server, you can either invoke
Desktop.addListener(java.lang.Object)manually, or specify the following in WEB-INF/zk.xml<listener> <listener-class>org.zkoss.zkmax.au.InaccessibleWidgetBlockService$DesktopInit</listener-class> </listener>This implementation considers a widget as inaccessible if it is invisible (
Component.isVisible()). If you want to block only certain events, you can specify a library property calledorg.zkoss.zkmax.au.IWBS.eventswith a list of the event names to block (separated with comma). For example, if want to block only onClick, onChange, and onSelect, you can specify the following in WEB-INF/zk.xml:<library-property> <name>org.zkoss.zkmax.au.IWBS.events</name> <value>onClick,onChange,onSelect</value> </library-property>In additions, you can override
service(org.zkoss.zk.au.AuRequest, boolean)to provide more accurate and versatile blocking. For example, if you want to block all events exceptonOpen:public boolean service(AuRequest request, boolean everError) { return super.service(request, everError) && !"onOpen".equals(request.getCommand()); }- Since:
- 5.0.0
- Author:
- tomyeh
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classInaccessibleWidgetBlockService.DesktopInitThe initial listener used to register in WEB-INF/zk.xml
-
Constructor Summary
Constructors Constructor Description InaccessibleWidgetBlockService()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanisDisable()booleanservice(org.zkoss.zk.au.AuRequest request, boolean everError)protected static booleanshallBlockPerComponent(org.zkoss.zk.au.AuRequest request)The default blocking policy.
-
-
-
Method Detail
-
service
public boolean service(org.zkoss.zk.au.AuRequest request, boolean everError)- Specified by:
servicein interfaceorg.zkoss.zk.au.AuService
-
isDisable
public static boolean isDisable()
-
shallBlockPerComponent
protected static boolean shallBlockPerComponent(org.zkoss.zk.au.AuRequest request)
The default blocking policy.
-
-