Search in sources :

Example 1 with CspPartialResponseWriter

use of org.primefaces.csp.CspPartialResponseWriter in project primefaces by primefaces.

the class PrimePartialViewContext method getPartialResponseWriter.

@Override
public PartialResponseWriter getPartialResponseWriter() {
    if (writer == null) {
        PartialResponseWriter parentWriter = getWrapped().getPartialResponseWriter();
        writer = new PrimePartialResponseWriter(parentWriter);
        FacesContext context = FacesContext.getCurrentInstance();
        PrimeConfiguration config = PrimeApplicationContext.getCurrentInstance(context).getConfig();
        if (config.isCsp()) {
            writer = new CspPartialResponseWriter(writer, context, PrimeFacesContext.getCspState(context));
        }
    }
    return writer;
}
Also used : FacesContext(javax.faces.context.FacesContext) PartialResponseWriter(javax.faces.context.PartialResponseWriter) CspPartialResponseWriter(org.primefaces.csp.CspPartialResponseWriter) PrimeConfiguration(org.primefaces.config.PrimeConfiguration) CspPartialResponseWriter(org.primefaces.csp.CspPartialResponseWriter)

Aggregations

FacesContext (javax.faces.context.FacesContext)1 PartialResponseWriter (javax.faces.context.PartialResponseWriter)1 PrimeConfiguration (org.primefaces.config.PrimeConfiguration)1 CspPartialResponseWriter (org.primefaces.csp.CspPartialResponseWriter)1