org.sitemesh.webapp.contentfilter
Interface Selector

All Known Implementing Classes:
BasicSelector

public interface Selector

Rules that will be used by the ContentBufferingFilter and HttpServletResponseBuffer to determine whether the response should be buffered. For a basic implementation, use BasicSelector.

Author:
Joe Walnes

Method Summary
 boolean shouldAbortBufferingForHttpStatusCode(int statusCode)
          Determine whether buffering should be used for a particular HTTP status code.
 boolean shouldBufferForContentType(String contentType, String mimeType, String encoding)
          Determine whether buffering should be used for a particular content-type.
 boolean shouldBufferForRequest(javax.servlet.http.HttpServletRequest request)
          Determine whether buffering should be used for a particular request.
 

Method Detail

shouldBufferForContentType

boolean shouldBufferForContentType(String contentType,
                                   String mimeType,
                                   String encoding)
Determine whether buffering should be used for a particular content-type. Use this to ensure that only content-types you care about are intercepted.

Parameters:
contentType - e.g. "text/html; charset=iso-8859-1"
mimeType - e.g "text/html"
encoding - e.g. "iso-8859-1" (may be null)

shouldAbortBufferingForHttpStatusCode

boolean shouldAbortBufferingForHttpStatusCode(int statusCode)
Determine whether buffering should be used for a particular HTTP status code. For example, some applications may choose to rewrite content of 404 error pages.

Parameters:
statusCode - e.g. 200, 302, 404, 500, etc. See constants in HttpServletResponse.

shouldBufferForRequest

boolean shouldBufferForRequest(javax.servlet.http.HttpServletRequest request)
Determine whether buffering should be used for a particular request. For example, elements like path, attributes, cookies, etc may influence this.



Copyright © 2011. All Rights Reserved.