title: post method not working in angular js
body: <p>I am trying to add data's in table by using angularjs, spring, and hibernet. 
  Below is the code that I am using :</p>
  
  <p><strong>addCustomer.js</strong></p>
  
  <pre><code>var addNewCustomerModule = angular.module('addNewCustomer',[]);
  var c=angular.module('addCustomerController',[]);
  
  addNewCustomerModule.controller('addCustomerController', function ($scope,$http) {
  
      //$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
  
       var urlBase="http://localhost:8081/manufacturing";
       var customerDetails={};
       $scope.addCustomer = function addCustomer() {
           customerDetails=$scope.customer;  
           alert("hai");
           $http.post(urlBase + '/addCustomer/new/',customerDetails).
              success(function(data) {
                 alert("Customer added");
                 $scope.customer = data; 
                });
            } 
       });
  </code></pre>
  
  <p><strong>addCustomer.jsp</strong></p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  
      pageEncoding="ISO-8859-1"%&gt;
  
  &lt;%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html ng-app="addNewCustomer"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Add Customer&lt;/title&gt;
  &lt;script data-require="angular.js@*" data-semver="1.2.13" src="http://code.angularjs.org/1.2.13/angular.js"&gt;&lt;/script&gt;
  &lt;script src="&lt;c:url value="/resources/js/addCustomer.js"/&gt;"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div ng-controller="addCustomerController"&gt;
  
  &lt;table&gt;
  
       &lt;tr&gt;
        &lt;td&gt; FirstName:&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.firstName"/&gt;&lt;/td&gt;
        &lt;td&gt;LastName:&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.lastName"/&gt;&lt;/td&gt;    
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;Designation&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.designation"/&gt;&lt;/td&gt;
        &lt;td&gt;Email&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.email"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;Phone&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.phone"/&gt;&lt;/td&gt;
        &lt;td&gt;Fax&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.fax"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;Website&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.website"/&gt;&lt;/td&gt;         
        &lt;td&gt;ContactType&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.contact_type"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;AddressTitle&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.addressTitle"/&gt;&lt;/td&gt;         
        &lt;td&gt;AddressLine1&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.addressLine1"/&gt;&lt;/td&gt;         
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;AddressLine2&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.addressLine2"/&gt;&lt;/td&gt;
        &lt;td&gt;City&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.city"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;State&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.state"/&gt;&lt;/td&gt;
        &lt;td&gt;Country&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.country"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;PinCode&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.pincode"/&gt;&lt;/td&gt; 
       &lt;/tr&gt;
  
       &lt;tr&gt;
        &lt;td&gt;Type&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.type"/&gt;&lt;/td&gt;
        &lt;td&gt;Name&lt;/td&gt;
        &lt;td&gt;&lt;input type="text" ng-model="customer.name"/&gt;&lt;/td&gt;
       &lt;/tr&gt;
  
       &lt;/table&gt;
  
       &lt;button ng-click="addCustomer()" class="btn-panel-big"&gt;Add New Customer&lt;/button&gt;&lt;/td&gt;
       &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p><strong>spring controller</strong></p>
  
  <pre><code> @RequestMapping(value="/addCustomer/new/",method=RequestMethod.POST)
      public String updateUser(@RequestBody Customer cu,HttpSession session) throws ParseException{
        customerService.addCustomer(cu);
        return "addCustomer";
    }  
  </code></pre>
  
  <p>Here  <strong>$http.post(urlBase + '/addCustomer/new/',customerDetails)</strong> it doesn't call my spring controller.i checked in browser debug it says url 404 error but i have the controller for this url. i don't know how to fix this can any one help me to fix this</p>