You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mufaddal Khumri <mk...@allegrocentral.com> on 2008/01/10 21:11:09 UTC

Application, Session, Request - Struts2 related ..

Hi,

Struts2 actions can implement one or all the interfaces to become  
Application, Session, Request aware. Struts2 then basically injects  
all the attributes in that particular scope in a map in your action.

Have 3 questions so far:

Que 1. Since these actions have their own copy of lets say the  
application attributes. At some pt while this action instance is  
alive some code may put in a new application attribute. Does this get  
injected in the action instance whose map was set already as well?

Que 2. Are their performance implications to be kept in mind since  
now action instances are not shared per request and each instance has  
its own copy of the attributes ?

Que 3. Since interceptor instances are shared across requests (please  
correct me if i am wrong). Is it more useful to make your interceptor  
Application or Session Aware and have the application and session map  
in the interceptor rather than in the Action?

Thanks
-Mufaddal.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Application, Session, Request - Struts2 related ..

Posted by Joachim Ansorg <ja...@ksi.gr>.
Hi,
>
> Que 2. Are their performance implications to be kept in mind since now 
> action instances are not shared per request and each instance has its 
> own copy of the attributes ?

If you use the Struts2 spring-pugin it is possible to set the action 
scope to singleton, session, request and protype.
So it's still possible to have actions per request.

Hope that helps,
Joachim

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org