Angular view affecting rest call
<p>When I try to make a call to my server, I get a 404 error. I previously tried doing this without using route provider (for different views), and it <strong>worked successfully.</strong> All of the code is pretty much the same, except for the addition of a new view. </p>

<p>My current URL to the page that requires the http get is <a href="http://localhost:8080/projectname/#/page1" rel="nofollow">http://localhost:8080/projectname/#/page1</a></p>

<p>This is the call itself (seen below)</p>

<p>var response = $http.get('/projectname/webapi/object/');</p>

<p>I'm guessing that there is something wrong with my path, but I'm not sure.</p>

<p>Please excuse any typos, as I covered up  names of some items...</p>

<p>java script</p>

<pre><code>var Demo = angular.module("Demo", ["ngRoute"])

.config(function ($routeProvider) {
$routeProvider
     .when("/page1",{
                templateUrl:"include/Templates/page1.html",
                controller:"TestController"
})
    .when("/page2",{
                templateUrl:"include/Templates/page2.html",
                controller:"Test2Controller"
})
.otherwise({redirectTo: "/page1"});
})
.controller("TestController", function ($scope, $filter, $http){

     var app = this;
        $scope.operation="";
        $scope.isSaveDisabled = true;
        $scope.isDeleteDisabled = true;

        var response = $http.get('/projectname/webapi/object/');
        response.success(function(data) {
          $scope.data = data;
          console.log($scope);
          angular.forEach(data, function(element) {
          });
        })
        response.error(function(data, status, headers, config) {
          alert("AJAX failed to get data, status=" + status);
        }) 
        ...
</code></pre>

<p>Object Resource</p>

<pre><code>  @Path("/object")
   public class objectResource {

   objectService objectService = new objectService();

@GET
@Produces(MediaType.APPLICATION_JSON)
public List&lt;object&gt; getobject() {
    return objectService.getAllobject();
}

@POST
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
public List&lt;object&gt; getChangedobject(List&lt;object&gt; object) {
    System.out.println(letter);

    return objectService.getChangedobject(object);
 }

}
</code></pre>

<p>web.xml</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!-- This web.xml file is not required when using Servlet 3.0 container,
 see implementation details                        http://jersey.java.net/nonav/documentation/latest/jax-rs.html --&gt;
&lt;web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;
    &lt;servlet&gt;
    &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
    &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-   class&gt;
    &lt;init-param&gt;
        &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
        &lt;param-value&gt;package.project&lt;/param-value&gt;
    &lt;/init-param&gt;
    &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
&lt;/servlet&gt;
&lt;servlet-mapping&gt;
    &lt;servlet-name&gt;Jersey Web Application&lt;/servlet-name&gt;
    &lt;url-pattern&gt;/webapi/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
&lt;/web-app&gt;
</code></pre>