如何从entityForm创建域实体对象?

时间:2015-03-22 07:36:48

标签: spring-mvc broadleaf-commerce

在Broadleaf Commerce框架中,我正在寻找一种方法来从实体表单中提取域名实体对象,例如产品管理员用户,我们在CRUD方法中将其作为模型属性接收EntityController类,如 AdminProductController 。可能吗?如果是,怎么样?

以下是AdminProductController类的示例代码。

@RequestMapping(value = "/add", method = RequestMethod.POST)
public String addEntity(HttpServletRequest request, HttpServletResponse response, Model model,
                @PathVariable  Map<String, String> pathVars,
                @ModelAttribute(value="entityForm") EntityForm entityForm, BindingResult result) throws Exception {
    //some code
}

0 个答案:

没有答案