在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
}