struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhouyanming (JIRA)" <j...@apache.org>
Subject [jira] Commented: (WW-3451) [FreemarkerManager] don't put ATTR_SESSION_MODEL into session
Date Sun, 23 May 2010 15:10:23 GMT

    [ https://issues.apache.org/jira/browse/WW-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870413#action_12870413
] 

zhouyanming commented on WW-3451:
---------------------------------

sorry for misunderstanding your suggestion,I thought you are suggesting  user write their
own filter to do that,but reuse  Struts Execute Filter have a bad smell too,because freemarker
view is not core function of struts2.

[quote]
 I would first look carefully at the Freemarker code and see why they rely on serialization.

[/quote]
it doesn't matter with freemarker,session replication will cause  serialization.
objects in session often are inconsistent in a cluster system,for example
node1  session.setAttribute("user",user);
node2 will receive a event triggerred by setAttribute method and replicate user object.
then node1 modify object's state like  user.setPassword("newpassword");
but in node2,user still have an old state unless you call session.setAttribute("user",user)
 everytime after  modifiy user.
so put object into session is evil.

you think new a HttpSessionHashModel every request could impact performance,have you do some
test to prove that?
my patch is identical with trunk code from function aspect,you can run unit tests to assert
it.
and identical from performance aspect due to your mistyping.

BTW:I don't think struts2 is crappy,I like it. 


> [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.


Mime
View raw message