Hi Desmond,

> Hi Luciano,
>
> Yes I was going to take a look at the Servlet Filter approach but if you
> have some code you can point me at. All the better.
>
> I just need to simple CORs implementation so my JavaScript(AngularJS)
front
> end can interact with my REST Interface. So I just want to accept
requests
> from any domain.


Here's a bit of sample code that sets the CORS header in a servlet (you can
do it in a filter or elsewhere).

<
https://github.com/krook/krook-service-provider/blob/master/src/net/bluemix/krook/provider/CorsProviderServlet.java
>

Instead of specifying a hostname for the "Access-Control-Allow-Origin"
header, use an asterisk "*" to accept from any client.

You can trace the flow of headers from consumer to provider here:

<http://krook-service-consumer.mybluemix.net>

Please note that there's nothing Wink related in this sample code. I just
pushed the consumer and provider WAR files to a PaaS (IBM Bluemix) to
demonstrate that they run on different hosts.



Daniel Krook
http://krook.info/

Reply via email to