Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/foo4u/cors-filter

Provides a basic cross-origin resource sharing Java servlet filter for 1.4+ JVMs
https://github.com/foo4u/cors-filter

Last synced: about 2 months ago
JSON representation

Provides a basic cross-origin resource sharing Java servlet filter for 1.4+ JVMs

Awesome Lists containing this project

README

        

# CORS Filter

Provides a [cross-origin resource sharing] [1] servlet filter compatible with Java 1.4+ JVMs.

This filter is intended to be simple and require no external runtime dependencies besides
the J2EE servlet API. It is by no means the most feature rich CORS servlet filter
implementation but instead focuses on simplicity, minimal code and support for the
legacy JDK 1.4.

## Usage

Add the filter and at least one filter mapping to your `web.xml` file.

```

CorsFilter
net.rossillo.cors.filter.SimpleCorsFilter

CorsFilter
/service/*

```

By default, only HTTP `GET` requests are permitted by the filter. To add support for other
HTTP request methods, declare them as a comma-delimited string via an init parameter.

For example, to support `GET`, `POST` and `PUT` requests, specify them as the value for the
`methods` configuration parameter.

```

CorsFilter
net.rossillo.cors.filter.SimpleCorsFilter

methods
GET, POST, PUT

```

## Downloading Artifacts

### Dependencies

```

net.rossillo.cors
cors-filter
${version}

```

### Repositories

```

releases
http://repo.rossillo.net/nexus/content/repositories/releases

snapshots
http://repo.rossillo.net/nexus/content/repositories/snapshots

```

## Building from Source

1. Clone the repository from GitHub
2. Navigate into the cloned repository directory
3. Use [Gradle] [2] to build the distribution

```
$ git clone git://github.com/foo4u/cors-filter.git
$ cd cors-filter
$ $ ./gradlew build
```

## Importing Sources Into Eclipse

1. Generate Eclipse metadata
2. Once complete, import into Eclipse `File -> Import -> Existing projects into workspace`

```
$ ./gradlew eclipse
```

## Issue Tracking

Report bugs and feature requests via [GitHub Issues] [3].

## Contributing

Pull requests welcome. Please follow these simple guidelines:

1. Fork the repository
2. Always work on topic branches (e.g. ISSUE-123)
3. Follow the "Commit Guidelines" outlined in [Pro Git] [4]
3. When ready to resolve an issue or to collaborate with others, you can push your branch to origin
4. When ready for your contribution to be reviewed for potential inclusion, send a pull request

## License

CORS Filter is licensed under the MIT License.

[1]: http://en.wikipedia.org/wiki/Cross-origin_resource_sharing "Wikipedia"
[2]: http://www.gradle.org "Gradle"
[3]: https://github.com/foo4u/cors-filter/issues "Issues"
[4]: http://git-scm.com/book/ch5-2.html "Pro-Git"