wink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars-Fredrik Smedberg <>
Subject Re: CORs support in JEE6 JAX-RS
Date Mon, 07 Jul 2014 21:45:21 GMT

For a more in-depth explanation of CORS see

For the simple scenario described in 6.1 of the w3c document you could
either implement it as a Wink or as a Servlet Filter, I would guess a
Servlet filter would be easier.

The simplest case implemented as a Servlet filter could look like:

1. In the doFilter check if the request contains the "Origin" header, if
not => send e.g. http status 403
2. Then check if the value of the "Origin" header corresponds to a value in
a whitelist, if not => send e.g. http status 403
3. Add a response header called "Access-Control-Allow-Origin" bouncing the
value found in the "Origin" header
4. Process the next filter/servlet in the filter chain

Lars-Fredrik Smedberg

On Sat, Jul 5, 2014 at 8:42 PM, DK <> wrote:

> I need to enable CORS support for my REST API?
> I assume I need to use Apache Wink HandlersFactory and ResponseHandler? Any
> examples?
> --
> View this message in context:
> Sent from the Apache Wink Users mailing list archive at

Med vänlig hälsning / Best regards

Lars-Fredrik Smedberg

The information contained in this electronic message and any
attachments to this message are intended for the exclusive use of the
address(es) and may contain confidential or privileged information. If
you are not the intended recipient, please notify Lars-Fredrik Smedberg
immediately at, and destroy all copies of this
message and any attachments.

View raw message