[ 
https://issues.apache.org/struts/browse/WW-2181?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wes Wannemacher updated WW-2181:
--------------------------------

    Attachment: SessionAware.java.patch

Looks like the original javadoc was a copy/paste from other similar interfaces 
(ServletRequestAware.java / ServletResponseAware.java). 

> SessionAware documentation misleading about unit testing?
> ---------------------------------------------------------
>
>                 Key: WW-2181
>                 URL: https://issues.apache.org/struts/browse/WW-2181
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.9
>            Reporter: Jim Cushing
>         Attachments: SessionAware.java.patch
>
>
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to