Javascript 不支持“获取单页web应用程序刷新”按钮

Javascript 不支持“获取单页web应用程序刷新”按钮,javascript,html,angularjs,spring-mvc,Javascript,Html,Angularjs,Spring Mvc,我正在使用angularjs和SpringMVC构建一个应用程序,我已经编写了RESTAPI,它将从后端获取数据,我正在使用AngularJSNG网格显示它。我的问题是,当我单击刷新按钮时,我得到的响应是HTTP状态405-请求方法“GET”不受支持我得到此响应的原因是什么?如何解决这个问题 有没有办法,若我点击浏览器的刷新按钮,它应该指向我的应用程序的登录页 角度js控制器代码 function customerController($scope,$http,$window,$location

我正在使用angularjs和SpringMVC构建一个应用程序,我已经编写了RESTAPI,它将从后端获取数据,我正在使用AngularJSNG网格显示它。我的问题是,当我单击刷新按钮时,我得到的响应是HTTP状态405-请求方法“GET”不受支持我得到此响应的原因是什么?如何解决这个问题

有没有办法,若我点击浏览器的刷新按钮,它应该指向我的应用程序的登录页

角度js控制器代码

function customerController($scope,$http,$window,$location,updateFactory) {

$scope.customerId;
$scope.customerEmail;
$scope.CustName;


$http.get("./getCustomer")

.success(function(response) {$scope.customers = response;});

 $scope.filterOptions = {
            filterText: ''
          };}
@RequestMapping(value="/getCustomer" , method=RequestMethod.GET)

public List<Customer> getCustomerList() throws IOException{

    List<Customer> customers= customerDao.getCustomer();
    return customers;
}
Spring Mvc控制器代码

function customerController($scope,$http,$window,$location,updateFactory) {

$scope.customerId;
$scope.customerEmail;
$scope.CustName;


$http.get("./getCustomer")

.success(function(response) {$scope.customers = response;});

 $scope.filterOptions = {
            filterText: ''
          };}
@RequestMapping(value="/getCustomer" , method=RequestMethod.GET)

public List<Customer> getCustomerList() throws IOException{

    List<Customer> customers= customerDao.getCustomer();
    return customers;
}
@RequestMapping(value=“/getCustomer”,method=RequestMethod.GET)
public List getCustomerList()引发IOException{
List customers=customerDao.getCustomer();
返回客户;
}

使用“get”时必须取消ajax缓存方法

$.ajax({
url:'xyz.com',
cache:false,
键入:“GET”,
数据:你的数据,
成功:成功功能,
错误:errorfunction

});您最好向我们展示如何调用RESTAPI(您的angularjs代码)以及控制器的实现。我想你没有很好地处理
@RequestMapping
。我添加了代码。我在发出请求时禁用了缓存,但它不起作用。如果我单击刷新页面,而不是刷新页面,它会提示到其他页面吗?尝试使用POST方法获取相同的链接