01: package org.bpmscript.web;
02:
03: import java.util.Map;
04:
05: import javax.servlet.http.HttpServletRequest;
06: import javax.servlet.http.HttpServletResponse;
07:
08: import org.springframework.web.servlet.ModelAndView;
09: import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
10:
11: public class ModelBeansInterceptor extends HandlerInterceptorAdapter {
12:
13: private Map<String, Object> beans;
14:
15: @SuppressWarnings("unchecked")
16: @Override
17: public void postHandle(HttpServletRequest request,
18: HttpServletResponse response, Object handler,
19: ModelAndView modelAndView) throws Exception {
20: modelAndView.getModel().putAll(beans);
21: }
22:
23: public void setBeans(Map<String, Object> beans) {
24: this.beans = beans;
25: }
26: }
|