@Override public void removeAttribute(String name) { if (isClosed) return; handleServletPathInfo(); if (origin.containsKey(name)) { StringBuilder txt = new StringBuilder(128); txt.append("Attempt to remove protected attribute ").append(name); txt.append(" will be ignored."); LOG.warn(txt.toString()); } else { // if attribute by encoded name exists, remove with encoded name. boolean encoded = false; Object val = getRequest().getAttribute(mapper.encode(winId, name)); if (val != null) { getRequest().removeAttribute(mapper.encode(winId, name)); encoded = true; } else { getRequest().removeAttribute(name); } if (isTrace) { StringBuilder txt = new StringBuilder(); txt.append("Removing: "); txt.append(name); txt.append(", encoded: ").append(encoded); LOG.debug(txt.toString()); } } }
} else { boolean encoded = true; val = getRequest().getAttribute(mapper.encode(winId, name)); if (val == null) { val = getRequest().getAttribute(name);
public String getNamespace() { if (namespace == null) { namespace = getPortletContainer().getContainerServices().getNamespaceMapper().encode(getPortletWindow().getId(), ""); StringBuffer validNamespace = new StringBuffer(); for (int i = 0; i < namespace.length(); i++) { char ch = namespace.charAt(i); if (Character.isJavaIdentifierPart(ch)) { validNamespace.append(ch); } else { validNamespace.append('_'); } } namespace = validNamespace.toString(); } return namespace; }
protected String encodeAttributeName(String name) { if (isReservedAttributeName(name)) { return name; } return container.getContainerServices().getNamespaceMapper().encode(window.getId(), name); }