public static boolean isRequestSource(UIComponent component, FacesContext context, String event) {
        ExternalContext externalContext = context.getExternalContext();
        String partialSource = externalContext.getRequestParameterMap().get(Constants.RequestParams.PARTIAL_SOURCE_PARAM);
        String partialEvent = externalContext.getRequestParameterMap().get(Constants.RequestParams.PARTIAL_BEHAVIOR_EVENT_PARAM);
        return component.getClientId(context).equals(partialSource) && partialEvent.equals(event);
    }
Creates an RFC 6266 Content-Dispostion header following all UTF-8 conventions.
<p>
@param value e.g. "attachment"
@param filename the name of the file
@return a valid Content-Disposition header in UTF-8 format
primefaces/src/main/java/org/primefaces/util/ComponentUtils.java