Sorry, I'm not a Java Developer so I will not be able to help if my last 
post didn't solved the issue.
For me the headers that you set in response looks fine...

I know that Chrome make a HEAD request to look for CORS headers and the do 
the asked request if last succeed.
Try to see if your server respond to HEAD requests by giving the CORS 
headers ;)

Try to post an question on StackOverflow for your CORS issue if this 
solution don't work.
This issue is out of the scope of Angular now :/

Good luck,
Charly.


On Monday, 7 July 2014 14:37:04 UTC+2, Jayanta Pramanik wrote:
>
> Hi,
> We are creating secured web application which is using Angular-JS in web 
> portal. Call to Java REST service is being made from pages. But we can not 
> make the REST call successfully. Here are code snippets for the Java side 
> REST service -
>
> java code::
>
> @Path("/users")
> public class UserRestService {
> @POST
> @Consumes(MediaType.APPLICATION_JSON)
> @Produces(MediaType.APPLICATION_JSON)
> public User create(User user) {
> User user = new User();
> return user ;
> }
> }
>
> angular js code ::
> service.js
> -----------------------
> var consumerREST = angular.module('consumerRESTService', ['ngResource']);
>
> consumerREST.factory('UsersFactory', function ($resource) {
> var services = {
> doCreateUser : $resource('http://localhost:8080/demoApp/service/users', 
> {}, {
> query: { method: 'GET', isArray: true },
> create: { method: 'POST' }
> })
> };
> return services;
> });
>
> controller.js
> ----------------------
> function MyAccountController($scope, $http){
> $scope.insertData = function (UsersFactory) {
> $scope.user = {id:1, firstname: 'AA', lastName: 'CC'};
> UsersFactory.doCreateUser($scope.user);
> }
>
> Error :: Following error is found in Javascript console of the browser -
>
> Cannot read property 'doCreateUser' of undefined
> at Object.MyAccountController.$scope.removeFetchedData1 (
> http://localhost:63342/angular-seed-master/app/js/controllers.js:358:21)
> at Object.MyAccountController.$scope.findAccountInfo (
> http://localhost:63342/angular-seed-master/app/js/controllers.js:334:16)
> .....
> ......
> Please help...
>
> Thanks in advance.
> Regards
> Jayanta Pramanik
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to