Re: MLHttpRequest cannot load

2015-12-06 Thread Shashank Dutt Jha
r response = $http({ method: "GET", headers: headers, url: 'http://localhost:9001/office/offices/123', 'X-Requested-With': 'XMLHttpRequest' It works for java rest client as well chrome rest app.

Re: MLHttpRequest cannot load

2015-12-05 Thread Shashank Dutt Jha
rgey Beryozkin wrote: > Perhaps allowOrigins should be set to a wildcard ? > > > On 04/12/15 11:09, Shashank Dutt Jha wrote: > >> still same error >> Error: >> XMLHttpRequest cannot load http://localhost:9001/office/offices/123. No >> 'Access-Cont

Re: MLHttpRequest cannot load

2015-12-04 Thread Shashank Dutt Jha
d) { System.out.println("Serving request to customer id\t"+id); return "Systems"; } } On Fri, Dec 4, 2015 at 4:21 PM, Shashank Dutt Jha wrote: > > @CrossOriginResourceSharing( > allowOrigins = { >"http://localhost:56696";, "*"

Re: MLHttpRequest cannot load

2015-12-04 Thread Shashank Dutt Jha
gt; return Response.ok().build(); > } > } > > @GET > @CrossOriginResourceSharing( > allowOrigins = { "http://localhost:56696"; }, > allowCredentials = true, > exposeHeaders = { "X-custom-3", "X-cus

Re: MLHttpRequest cannot load

2015-12-03 Thread Shashank Dutt Jha
m("echo") String echo) { return echo; } On Thu, Dec 3, 2015 at 4:51 PM, Sergey Beryozkin wrote: > 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 > >

Re: 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 req

2015-12-03 Thread Shashank Dutt Jha
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 wrote: > Server side code: > >protected Server() throws Exception { > JAXRSServerFactoryBean sf = new JAXRSServe

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 request

2015-12-01 Thread Shashank Dutt Jha
Server side code: protected Server() throws Exception { JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); sf.setResourceClasses(CustomerService.class); sf.setResourceProvider(CustomerService.class, new SingletonResourceProvider(new CustomerService()))