You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OpenSessionInViewInterceptor and
legacy xt ajax interceptor that utilizes postHandle method and uses ModelAndView returned from controller to get command object - i.e. i can't return null from controller, i need modelAndView in interceptor.
the problem is that i get "javax.servlet.ServletException: ModelAndView [ModelAndView: materialized View is [null]; model is {}] neither contains a view name nor a View object" exceotion in DispatcherServlet after ajax submit event.
My ajax interceptor prepares the response and clears ModelAndView, but WebRequestHandlerInterceptorAdapter, which wraps OpenSessionInViewInterceptor calls getModel() on my modelAndView object. This creates an empty model map in modelNadView:
public ModelMap getModelMap() {
if (this.model == null) {
this.model = new ModelMap();
}
return this.model;
}
and modelAndView.wasCleared() is no longer true.
Affects: 2.5.6
The text was updated successfully, but these errors were encountered:
miceuz opened SPR-5505 and commented
I have two interceptors in my HandlerMapping:
OpenSessionInViewInterceptor and
legacy xt ajax interceptor that utilizes postHandle method and uses ModelAndView returned from controller to get command object - i.e. i can't return null from controller, i need modelAndView in interceptor.
the problem is that i get "javax.servlet.ServletException: ModelAndView [ModelAndView: materialized View is [null]; model is {}] neither contains a view name nor a View object" exceotion in DispatcherServlet after ajax submit event.
My ajax interceptor prepares the response and clears ModelAndView, but WebRequestHandlerInterceptorAdapter, which wraps OpenSessionInViewInterceptor calls getModel() on my modelAndView object. This creates an empty model map in modelNadView:
public ModelMap getModelMap() {
if (this.model == null) {
this.model = new ModelMap();
}
return this.model;
}
and modelAndView.wasCleared() is no longer true.
Affects: 2.5.6
The text was updated successfully, but these errors were encountered: