Please do not copy exception traces into Subject :-)

Have a look at
http://cxf.apache.org/docs/jax-rs-cors.html

Register that filter as a provider

Sergey
On 03/12/15 11:04, Shashank Dutt Jha wrote:
I want the REST server to be accessible to web/ browser app. Which is
correct example to refer to.

On Wed, Dec 2, 2015 at 11:15 AM, Shashank Dutt Jha <[email protected]>
wrote:

Server side code:

    protected Server() throws Exception {
         JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
         sf.setResourceClasses(CustomerService.class);
         sf.setResourceProvider(CustomerService.class,
             new SingletonResourceProvider(new CustomerService()));
         sf.setAddress("http://161.85.91.7:9000/";);
         sf.create();


-------
When I try to connect to server from chrome browser I get following error

MLHttpRequest cannot load http://161.85.91.7:9001/office/offices/123.
Response to preflight request doesn't pass access control check: No
'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://localhost:56696' is therefore not allowed access.


How to resolve this issue?






--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to