Skip navigation links

Package com.thetransactioncompany.cors

Cross-Origin Resource Sharing (CORS) Filter

See: Description

Package com.thetransactioncompany.cors Description

Cross-Origin Resource Sharing (CORS) Filter

This package provides a Java servlet filter that implements the Cross-Origin Resource Sharing (CORS) mechanism for making cross-site HTTP requests from web browsers. The CORS W3C working draft stabilised in 2009 and as of 2010 CORS is supported by all major browsers such as Firefox, Safari, Chrome and IE.

To enable CORS for a particular HTTP resource, such as a servlet, JSP or plain HTML file, attach a CORSFilter to it via a <filter-mapping> element in the web.xml descriptor file. The default CORS filter policy is to allow any origin (including credentials). To impose a stricter access policy configure the filter using the supported <init-param> elements or a Java properties file. See the CORSFilter JavaDoc for configuration details.

The CORS Filter can be configured to tag the allowed CORS HTTP requests with HttpServletRequest.addAttribute to provide the following information to downstream handlers:

This CORS filter version implements the W3C recommendation from 16 January 2014.

Supported CORS request types:

Supported CORS headers:

Package dependencies:

Skip navigation links

Copyright © 2010–2019 The Transaction Company. All rights reserved.