use of javax.faces.context.ResponseWriter in project muikku by otavanopisto.
the class WidgetSpaceComponent method encodeEnd.
@Override
public void encodeEnd(FacesContext context) throws IOException {
if (getKeepEmpty() || (!isEmpty())) {
ResponseWriter writer = context.getResponseWriter();
writer.write("</div>");
}
}
use of javax.faces.context.ResponseWriter in project muikku by otavanopisto.
the class WidgetSpaceSetComponent method encodeEnd.
@Override
public void encodeEnd(FacesContext context) throws IOException {
ResponseWriter writer = context.getResponseWriter();
writer.endElement("div");
super.encodeEnd(context);
}
use of javax.faces.context.ResponseWriter in project deltaspike by apache.
the class WindowIdHtmlRenderer method encodeBegin.
/**
* 'deltaspikeJsWindowId' will be used to:
* Write a simple hidden field into the form.
* This might change in the future...
* @param context
* @param component
* @throws IOException
*/
@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
super.encodeBegin(context, component);
lazyInit();
ClientWindowConfig.ClientWindowRenderMode clientWindowRenderMode = clientWindowConfig.getClientWindowRenderMode(context);
// see DELTASPIKE-1113
boolean delegatedWindowMode = ClientWindowConfig.ClientWindowRenderMode.DELEGATED.equals(clientWindowRenderMode);
if (delegatedWindowMode) {
return;
}
String windowId = clientWindow.getWindowId(context);
// just to get sure if a user provides a own client window
windowId = secureWindowId(windowId);
ResponseWriter writer = context.getResponseWriter();
writer.write("<script type=\"text/javascript\">");
writer.write("(function(){");
writer.write("dswh.init('");
writer.writeText(windowId, null);
writer.write("','" + clientWindowRenderMode.name() + "'," + maxWindowIdLength + ",{");
writer.write("'tokenizedRedirect':" + clientWindowConfig.isClientWindowTokenizedRedirectEnabled());
writer.write(",'storeWindowTreeOnLinkClick':" + clientWindowConfig.isClientWindowStoreWindowTreeEnabledOnLinkClick());
writer.write(",'storeWindowTreeOnButtonClick':" + clientWindowConfig.isClientWindowStoreWindowTreeEnabledOnButtonClick());
// see #729
if (clientWindow.isInitialRedirectSupported(context)) {
Object cookie = ClientWindowHelper.getRequestWindowIdCookie(context, windowId);
if (cookie != null && cookie instanceof Cookie) {
Cookie servletCookie = (Cookie) cookie;
writer.write(",'initialRedirectWindowId':'" + secureWindowId(servletCookie.getValue()) + "'");
// expire/remove cookie
servletCookie.setMaxAge(0);
((HttpServletResponse) context.getExternalContext().getResponse()).addCookie(servletCookie);
}
}
writer.write("});");
writer.write("})();");
writer.write("</script>");
}
Aggregations