【问题标题】:JHipster- Connecting Spring controller to angular js buttonJHipster-将 Spring 控制器连接到 Angular js 按钮
【发布时间】:2017-03-06 07:48:25
【问题描述】:

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

【问题讨论】:

  • 是JHipster生成的API?
  • 你能贴出角按钮的代码吗?我认为这不仅仅是一个简单的锚标记。

标签: angularjs spring spring-boot jhipster


【解决方案1】:

<a>标签中直接调用你的APIhref

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);
    }

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-11-14
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多