public class Bridge extends Object
Bridge bridge = Bridge.start(svlctx, request, response, desktop);
try {
//execution is activated and you could access anything belonging to the desktop
String jscode = bridge.getResult();
//send jscode back to the client to update DOM, if any
} finally {
bridge.close(); //stop the execution
}
| Modifier | Constructor and Description |
|---|---|
protected |
Bridge(javax.servlet.ServletContext svlctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.zkoss.zk.ui.Desktop desktop,
Object locale)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the execution such that other requests targeting
the same desktop can be processed.
|
static org.zkoss.zk.ui.Desktop |
getDesktop(javax.servlet.ServletContext svlctx,
javax.servlet.http.HttpServletRequest request,
String dtid)
Returns the desktop of the given desktop ID, or null if not found.
|
org.zkoss.zk.ui.Execution |
getExecution()
Returns the execution.
|
String |
getResult()
Returns the result in the JavaScript.
|
static Bridge |
start(javax.servlet.ServletContext svlctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.zkoss.zk.ui.Desktop desktop)
Starts an execution.
|
protected Bridge(javax.servlet.ServletContext svlctx,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.zkoss.zk.ui.Desktop desktop,
Object locale)
throws Exception
start(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, org.zkoss.zk.ui.Desktop) instead.Exceptionpublic static Bridge start(javax.servlet.ServletContext svlctx, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.zkoss.zk.ui.Desktop desktop)
After processing, the caller shall invoke close() to stop
the execution (in the finally clause).
desktop - the desktop you want to access.
You could retrieve by use of getDesktop(javax.servlet.ServletContext, javax.servlet.http.HttpServletRequest, java.lang.String).public static org.zkoss.zk.ui.Desktop getDesktop(javax.servlet.ServletContext svlctx,
javax.servlet.http.HttpServletRequest request,
String dtid)
dtid - the desktop's ID.public org.zkoss.zk.ui.Execution getExecution()
public String getResult()
eval(jscode);).
After calling this method, the caller shall not modify the component's state any more.
public void close()
Copyright © 2019. All rights reserved.