ajax实现跨域请求

在spring3.0以上直接在contraller层加上      @CrossOrigin

例子:

    @CrossOrigin
    @ResponseBody
    @RequestMapping("/list2/{pageNum}/{pageSize}")
    public PageInfo getAllFyCustomer(@PathVariable Integer pageNum,@PathVariable Integer pageSize) throws Exception{
   
        return fyCustomerService.getAllFyCustomerAndIntentionaddr(pageNum, pageSize);
    }
   

你可能感兴趣的:(javaweb)