Accessing the ActionContext is considered tying youself to a specific
implementation, plus it makes unit testing the Action more involved (since
you have to provide a fully functional ActionContext). Whereas implementing
ServletRequestAware is "programming to interfaces" (which is good practice)
and only requires the injection of necessary Objects by the unit tests.
  (*Chris*)
On Sep 5, 2011 3:11 AM, "mohan rao" <mohanara...@gmail.com> wrote:
> You can obtain the request by asking the ActionContext or implementing
> ServletRequestAware. Implementing ServletRequestAwareis preferred.
>
> *why it's not preferable accessing through ActionContext even though it's
> thread safe. If it's true why we need session,request,response,params
> interceptors*
>
>
http://struts.apache.org/2.0.11.1/docs/how-can-we-access-the-httpservletrequest.html
>
> --
> View this message in context:
http://struts.1045723.n5.nabble.com/Doubt-on-Accessing-Session-from-ActionContext-tp4769431p4769431.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>

Reply via email to