JHipster-将弹簧控制器连接到角度js按钮

时间:2016-10-24 13:42:59

标签: angularjs spring spring-boot jhipster

我有一个应用程序,其中一个按钮必须调用一个弹簧控制器。我如何将它们连接在一起? 我还没有找到任何明确的信息。

1 个答案:

答案 0 :(得分:2)

直接在href标记

中的<a>中调用您的API

API:http://192.168.1.17:8080/product/download/excel

<a href="/product/download/excel" > Start Download </a>

控制器:

@RequestMapping(value="/product/download/excel", method=RequestMethod.GET)
    public Object downloadExcel(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse){
        return productService.downloadExcel(httpServletRequest,httpServletResponse);
    }