本文整理了Java中org.zkoss.zk.ui.Desktop.getUpdateURI()
方法的一些代码示例,展示了Desktop.getUpdateURI()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Desktop.getUpdateURI()
方法的具体详情如下:
包路径:org.zkoss.zk.ui.Desktop
类名称:Desktop
方法名:getUpdateURI
[英]Returns the URI for asynchronous update.
You rarely need this method unless for implementing special components, such as file upload.
[中]返回异步更新的URI。
除非用于实现特殊组件(如文件上载),否则很少需要此方法。
代码示例来源:origin: org.zkoss.zk/zk
public void sendRedirect(String uri, boolean respRedirect) {
if (!respRedirect) {
sendRedirect(uri);
return;
} else {
uri = uri == null ? "" : uri;
HttpServletResponse resp = (HttpServletResponse) getNativeResponse();
try {
String destUrl = encodeURL(uri);
String destUrlParam = URLEncoder.encode(destUrl, "utf-8");
String updateURI = _desktop.getUpdateURI(
AuRedirect.URI_PREFIX + "?" + AuRedirect.REDIRECT_URL_PARAMETER + "=" + destUrlParam);
updateURI = resp.encodeRedirectURL(updateURI);
resp.setHeader("Location", updateURI);
resp.setStatus(HttpServletResponse.SC_FOUND);
} catch (UnsupportedEncodingException e) {
_zklog.warn("", e);
}
}
}
代码示例来源:origin: org.zkoss.zk/zkmax
_dls.put(path, new Character(type));
return desktop.getUpdateURI(sb.toString());
代码示例来源:origin: org.zkoss.zk/zkplus
public void render(Page page, Writer out) throws IOException {
out.write(HtmlPageRenders.outLangStyleSheets(_exec, null, null));
out.write(HtmlPageRenders.outLangJavaScripts(_exec, null, null));
if (_pageDOM) {
HtmlPageRenders.outPageContent(_exec, page, out, false);
return;
}
final Desktop desktop = _exec.getDesktop();
out.write("<script class=\"z-runonce\" type=\"text/javascript\">zkpb('");
out.write(page.getUuid());
out.write("','");
out.write(desktop.getId());
out.write("','");
out.write(getContextURI());
out.write("','");
out.write(desktop.getUpdateURI(null));
out.write("','");
out.write(desktop.getRequestPath());
out.write('\'');
String style = page.getStyle();
if (style != null && style.length() > 0) {
out.write(",{style:'");
out.write(style);
out.write("'}");
}
out.write(");zkpe();</script>\n");
for (Component root = page.getFirstRoot(); root != null; root = root.getNextSibling()) {
HtmlPageRenders.outStandalone(_exec, root, out);
}
}
代码示例来源:origin: org.zkoss.zk/zk
if (desktop != null && exec.getAttribute(ATTR_DESKTOP_JS_GENED) == null) {
sb.append("<script class=\"z-runonce\" type=\"text/javascript\">\nzkdt('").append(desktop.getId())
.append("','").append(getContextURI(exec)).append("','").append(desktop.getUpdateURI(null))
.append("','").append(desktop.getRequestPath()).append("');").append(outSpecialJS(desktop))
.append("\n</script>\n");
代码示例来源:origin: org.zkoss.zk/zuljsp
out.write(getContextURI(exec));
out.write("','");
out.write(desktop.getUpdateURI(null));
out.write("','");
out.write(desktop.getRequestPath());
代码示例来源:origin: org.zkoss.zk/zkplus
protected void sendRedirect(HttpServletRequest request, HttpServletResponse response, String url)
throws IOException {
if (url == null) {
return; //skip
}
final Event evt = (Event) (request).getSession().getAttribute(ZkEventExceptionFilter.EVENT);
final Component comp = evt.getTarget();
final String updateURI = comp.getDesktop().getUpdateURI(null);
if (url.indexOf(updateURI) >= 0) { //saved request
Events.postEvent(new Event(ON_LOGIN_OK, comp, null)); //post onLoginOK event
if (_resendZkEvent) {
(request).getSession().removeAttribute(ZkEventExceptionFilter.EVENT);
Events.postEvent(evt);
}
return;
}
//must redirect
if (url.startsWith("http://") || url.startsWith("https://")) {
Executions.getCurrent().sendRedirect(url);
return;
}
//other url, assume login fail
if (!comp.isListenerAvailable(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, true)) {
final EventListener<Event> listener = new ShowWindowEventListener<Event>();
comp.setAttribute(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, listener);
comp.addEventListener(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, listener);
}
Events.postEvent(new Event(ZkAuthenticationEntryPoint.ON_ACEGILOGIN, comp, url));
}
代码示例来源:origin: org.zkoss.zk/zk
appendProp(props, "dt", desktop.getId());
appendProp(props, "cu", getContextURI(exec));
appendProp(props, "uu", desktop.getUpdateURI(null));
appendProp(props, "ru", desktop.getRequestPath());
内容来源于网络,如有侵权,请联系作者删除!