ro.isdc.wro.http.support
Class ResponseHeadersConfigurer

java.lang.Object
  extended by ro.isdc.wro.http.support.ResponseHeadersConfigurer

public class ResponseHeadersConfigurer
extends Object

Responsible for configuring response headers. The configured headers contains the default headers overridden by those set through "headers" property.

Since:
1.4.9
Author:
Alex Objelean

Constructor Summary
ResponseHeadersConfigurer()
           
ResponseHeadersConfigurer(String headersAsString)
           
 
Method Summary
 void configureDefaultHeaders(Map<String,String> map)
          Allow configuration of default headers.
static ResponseHeadersConfigurer emptyHeaders()
          Factory method which creates a ResponseHeadersConfigurer containing no headers set.
static ResponseHeadersConfigurer fromConfig(WroConfiguration config)
          Factory method which creates a ResponseHeadersConfigurer containing headers used to disable cache in debug mode.
static ResponseHeadersConfigurer noCache()
          Factory method which creates a ResponseHeadersConfigurer containing headers used to disable cache.
 void setHeaders(javax.servlet.http.HttpServletResponse response)
          Method called for each request and responsible for setting response headers, used mostly for cache control.
protected static void useDefaultsFromConfig(WroConfiguration config, Map<String,String> map)
          Deprecated. will be removed when other deprecated methods requiring this method will be removed.
static ResponseHeadersConfigurer withHeadersSet(String headersAsString)
          Factory method which creates a ResponseHeadersConfigurer containing headers provided as string (separated by | character).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseHeadersConfigurer

public ResponseHeadersConfigurer()

ResponseHeadersConfigurer

public ResponseHeadersConfigurer(String headersAsString)
Parameters:
headersAsString - string representation of the headers to add separated by | character.
Method Detail

noCache

public static ResponseHeadersConfigurer noCache()
Factory method which creates a ResponseHeadersConfigurer containing headers used to disable cache.


emptyHeaders

public static ResponseHeadersConfigurer emptyHeaders()
Factory method which creates a ResponseHeadersConfigurer containing no headers set.


fromConfig

public static ResponseHeadersConfigurer fromConfig(WroConfiguration config)
Factory method which creates a ResponseHeadersConfigurer containing headers used to disable cache in debug mode.


withHeadersSet

public static ResponseHeadersConfigurer withHeadersSet(String headersAsString)
Factory method which creates a ResponseHeadersConfigurer containing headers provided as string (separated by | character).


configureDefaultHeaders

public void configureDefaultHeaders(Map<String,String> map)
Allow configuration of default headers. This is useful when you need to set custom expires headers.

Parameters:
map - the Map where key represents the header name, and value - header value.

useDefaultsFromConfig

@Deprecated
protected static void useDefaultsFromConfig(WroConfiguration config,
                                                       Map<String,String> map)
Deprecated. will be removed when other deprecated methods requiring this method will be removed.

Encapsulates the default headers set based on WroConfiguration. This exist for backward compatibility and exist for internal usage only (do not call this method explicitly).


setHeaders

public void setHeaders(javax.servlet.http.HttpServletResponse response)
Method called for each request and responsible for setting response headers, used mostly for cache control. Override this method if you want to change the way headers are set.

Parameters:
response - HttpServletResponse object.


Copyright © 2008-2013. All Rights Reserved.