Broadleaf默认已经提供了http api的controller,只需要enable就可以了。
需要修改site /src/main/webapp/WEB-INF/applicationContext-servlet.xml,添加
需要修改site /src/main/webapp/WEB-INF/applicationContext-servlet.xml,添加
<context:component-scan base-package="com.mycompany.api" />
然后启动demoSite项目。
然后启动demoSite项目。
访问方式
方法二: 使用firefox浏览器访问
http://172.31.93.150:8080/catalog/product/5,编辑header,添加
Content-Type: application/json,然后执行resend,在response tab页查看返回的结构

本文详细介绍了如何在Broadleaf中启用并配置HTTPAPI controller,包括修改配置文件和提供两种访问方法:wget命令行操作和Firefox浏览器访问。
576

被折叠的 条评论
为什么被折叠?



