Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.9
-
None
Description
The SessionAware JavaDocs state:
"Note that using this interface makes the Action tied to a servlet environment, so it should be avoided if possible since things like unit testing will become more difficult."
Unit testing with SessionAware is actually quite simple, compared to accessing the session through ActionContext, and SessionAware makes the Action less bound to a servlet environment than ServletRequestAware, another possible means of accessing the session.
It could be argued that using sessions at all makes ties an Action to a servlet environment, but this statement instead implies that users should find a different means of getting at the session to improve unit testability. I believe that's misleading.