public final class ComponentFunc extends Object implements freemarker.template.TemplateMethodModel
在主模版里引入前端组件,调用组件控制器进行处理,最终返回组件渲染好的 HTML 到主模版中。 主模版中的调用方式:
${component("toolBar", "http://localhost:8080/toolbar", "{}")}
${component("toolBar", "/toolbar", "{}")}
public Object exec(List arguments) throws freemarker.template.TemplateModelException
exec
在接口中 freemarker.template.TemplateMethodModel
arguments
- 指定的调用实参,例如,
[ "buttonBar", // 组件名 "http://localhost:8080/componentName", // 远程访问 组件控制器请求 URL "/componentName" // 本地调用组件请求URI "{....}", // JSON 字符串,组件控制器调用实参 ]
freemarker.template.TemplateModelException
Copyright © 2014 EPIC Team. All rights reserved.