按照标准用法的话应该是没问题
内部其实把model 通过request.setAttribute(modelName, modelValue); 放入的
protected void exposeModelAsRequestAttributes(Map model, HttpServletRequest request) throws Exception {
for (Map.Entry entry : model.entrySet()) {
String modelName = entry.getKey();
Object modelValue = entry.getValue();
if (modelValue != null) {
request.setAttribute(modelName, modelValue);
if (logger.isDebugEnabled()) {
logger.debug("Added model object '" + modelName + "' of type [" + modelValue.getClass().getName() +
"] to request in view with name '" + getBeanName() + "'");
}
}
else {
request.removeAttribute(modelName);
if (logger.isDebugEnabled()) {
logger.debug("Removed model object '" + modelName +
"' from request in view with name '" + getBeanName() + "'");
}
}
}
}
一个可能是你实现了HandlerInterceptor并实现了:
void postHandle(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object o, org.springframework.web.servlet.ModelAndView modelAndView) throws java.lang.Exception;
在此处修改了modelAndView
posted on 2012-12-17 15:41 墙头草 阅读(7907) 评论(2) 编辑 收藏