我想为管理端(broadleaf 框架)创建自己的控制器,它扩展了 AdminBasicEntityController。有我的控制器代码:
public class AdminArticleController extends AdminBasicEntityController {
@Autowired
private ArticleService articleService;
@Override
public String addEntity(HttpServletRequest request, HttpServletResponse response, Model model, @PathVariable Map<String, String> pathVars, @ModelAttribute("entityForm") EntityForm entityForm, BindingResult result) throws Exception {
return super.addEntity(request, response, model, pathVars, entityForm, result);
}
@Override
public String saveEntityJson(HttpServletRequest request, HttpServletResponse response, Model model, @PathVariable Map<String, String> pathVars, @PathVariable("id") String id, @ModelAttribute("entityForm") EntityForm entityForm, BindingResult result, RedirectAttributes ra) throws Exception {
return super.saveEntityJson(request, response, model, pathVars, id, entityForm, result, ra);
// articleService.updateArticleEntity();
}
}
我还在 AdminServletConfig 文件中添加了下一个代码:
@Bean
public AdminBasicEntityController adminBasicEntityController() {
return new AdminArticleController();
}
开满天机
相关分类