1
我正在处理遗留项目,将其转换为基于MVC的注释。我注意到在的onsubmit方法很多次,在以下模式如下:用于处理弹簧MVC的表单提交异常的模式
public ModelAndView onSubmit(Command command) {
try {
service.doSomeBusinessLogic(command);
}
catch (ServiceException) {
//return one type of model and view here
}
//return another type of model and view here
}
直观地给我,放在这里这个异常处理是错误的,但我不能确定什么替代解决方案春天给我?任何想法或者这不是像我想的那样是反模式?