Как заменить метод handleRequestInternal в Spring 5?JAVA

Программисты JAVA общаются здесь
Anonymous
Как заменить метод handleRequestInternal в Spring 5?

Сообщение Anonymous »

Я переношу приложение с Spring 4 на Spring 5.
Я получил класс public class WebRequestViewController, расширяющий AbstractController с переопределенным методом

Код: Выделить всё

@Override
protected final ModelAndView handleRequestInternal(HttpServletRequest httpRequest, HttpServletResponse httpResponse) {
try {
final WebRequest webRequest = new WebRequest(httpRequest);
final SpringPropertyMessageLookup messageLookup = new SpringPropertyMessageLookup(getApplicationContext(), httpRequest.getLocale(),
"comp");

final ModelAndView modelAndView = new ModelAndView(webRequestHandler.getViewName());

webRequestHandler.handleWebRequest(webRequest, modelAndView.getModel(), messageLookup);

return modelAndView;
} catch (Exception e) {
throw new RuntimeException("Exception for [" + webRequestHandler + "]", e);
}
}
Проблема в том, что в Spring 5 метод handleRequestInternal был удален.
Я добавил аннотацию для класса RequestViewController:

Код: Выделить всё

@Controller
public class RequestViewController {
и этого достаточно для сборки и запуска, но где мне разместить логику для поиска ModelAndView?

Подробнее здесь: https://stackoverflow.com/questions/790 ... n-spring-5

Вернуться в «JAVA»