[
https://issues.apache.org/jira/browse/WW-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870341#action_12870341
]
zhouyanming commented on WW-3451:
---------------------------------
HttpSession session = request.getSession(false);
HttpSessionHashModel sessionModel;
if (session != null) {
sessionModel = (HttpSessionHashModel)
session.getAttribute(ATTR_SESSION_MODEL);
if (sessionModel == null) {
sessionModel = new HttpSessionHashModel(session, wrapper);
session.setAttribute(ATTR_SESSION_MODEL, sessionModel);
}
model.put(KEY_SESSION, new HttpSessionHashModel(session, wrapper));
}
here sessionModel is put into session,but didn't use it elsewhere,everytime it
will new HttpSessionHashModel(session, wrapper)
put objects that user didn't known is a bad smell,and new a instance is not so
expensive in comparison to serialization and deserialization
> [FreemarkerManager] don't put ATTR_SESSION_MODEL into session
> ----------------------------------------------------------------
>
> Key: WW-3451
> URL: https://issues.apache.org/jira/browse/WW-3451
> Project: Struts 2
> Issue Type: Bug
> Reporter: zhouyanming
> Priority: Critical
> Attachments: patch.txt
>
>
> put ATTR_SESSION_MODEL into session is useless in current code, and harmful
> for distributed system
> and remove some other useless code,please see patch.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.