* @see ExternalContext#encodeActionURL(String)
*/
public String encodeActionURL(String url) {
Util.notNull("url", url);
FacesContext context = FacesContext.getCurrentInstance();
ClientWindow cw = context.getExternalContext().getClientWindow();
boolean appendClientWindow = false;
if (null != cw) {
appendClientWindow = cw.isClientWindowRenderModeEnabled(context);
}
if (appendClientWindow && -1 == url.indexOf(ResponseStateManager.CLIENT_WINDOW_URL_PARAM)) {
if (null != cw) {
String clientWindowId = cw.getId();
StringBuilder builder = new StringBuilder(url);
int q = url.indexOf(UrlBuilder.QUERY_STRING_SEPARATOR);
if (-1 == q) {
builder.append(UrlBuilder.QUERY_STRING_SEPARATOR);
} else {
builder.append(UrlBuilder.PARAMETER_PAIR_SEPARATOR);
}
builder.append(ResponseStateManager.CLIENT_WINDOW_URL_PARAM).append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR).append(clientWindowId);
Map<String, String> additionalParams = cw.getQueryURLParameters(context);
if (null != additionalParams) {
for (Map.Entry<String, String> cur : additionalParams.entrySet()) {
builder.append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR);
builder.append(cur.getKey()).
append(UrlBuilder.PARAMETER_NAME_VALUE_SEPARATOR).