*/
public class PortletAjaxViewRootRenderer extends AjaxViewRootRenderer {
protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
ExternalContext externalContext = context.getExternalContext();
Object namespace = externalContext.encodeNamespace("");
AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
Map<String, Object> requestMap = externalContext.getRequestMap();
if(requestMap.containsKey("javax.servlet.error.exception")||requestMap.containsKey("javax.servlet.error.status_code")){
// All error pages rendered as non-ajax.
ajaxContext.setAjaxRequest(false);