Interface ExecutionInit
-
- All Known Implementing Classes:
OpenEntityManagerInViewListener
public interface ExecutionInit
Used to initialize an execution when it is created.How this interface is used.
- First, you specify a class that implements this interface in WEB-INF/zk.xml as a listener.
- Then, even time ZK loader creates a new execution, an instance of
the specified class is instantiated and
init(org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Execution)
is called.
- Author:
- tomyeh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
init(Execution exec, Execution parent)
Called when an execution is created and initialized.
-
-
-
Method Detail
-
init
void init(Execution exec, Execution parent) throws java.lang.Exception
Called when an execution is created and initialized.Note: this method is called after exec is activated. In other words,
Executions.getCurrent()
is the same as the exec argument.When this method is called, you can retrieve the current page with
ExecutionCtrl.getCurrentPage()
. However, the page is not initialized yet. In other words,Page.getDesktop()
,Page.getId()
andPage.getTitle()
all return null. To get the current desktop, you have to useExecution.getDesktop()
(fromExecutions.getCurrent()
) instead. On the other hand, you can set the page's ID, title or style in this method (to override the declarations in the page definition) byPage.setId(java.lang.String)
,Page.setTitle(java.lang.String)
andPage.setStyle(java.lang.String)
. In additions,Page.getRequestPath()
andPage.getAttribute(java.lang.String, int)
are all available.- Parameters:
exec
- the execution being created.parent
- the previous execution in the same (Servlet) request, or null if this is the first execution of the request.- Throws:
java.lang.Exception
-
-