>> Would it not be perhaps safer and more efficient (and reduce the
>> possibility of clustered session replication issues) to simply
>> get the session yourself and set the
>> attributes directly into it?

the Map passed in when you implement SessionAware is just a wrapper
around the real session. So any changes that you make to the Map are
immediately written out to the real session, so there shouldn't be any
problem with session replication. Though I must confess, I don't know
what you mean that the problem was with the JSESSIONID parameter.

>> What benefit is there to making struts the
>> middleman and using a separate Hashmap?

This decouples your action from the underlying servlets, while minimally
coupling you to Struts. As a result, your action is only tied to the
Map. This makes testing easier: just pass in a normal HashMap to the
setSession() method rather than a mock HttpSession. By decoupling like
this, your code is more of a POJO and less of a Struts-specific Action
(and certainly less tied to the Servlet spec), thus enabling the logic
to be used elsewhere, perhaps in a different project, or in the same
project but after moving to an alternative front-end framework.

Brad Cupit
Louisiana State University - UIS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to