Is there any sample code where I can see the use of scope interceptor in Struts2? I want to pass a parameter from one action to other action (configured through struts.xml) & want to use scope interceptor.
Since I’m new to Struts 2, can any one provide sample of using scope interceptor?
I believe this is very well described in the Struts2 documentation.hers is all you have to do
All you need to take care is that, you have a getter in ActionA and and a similar setter in actionB. Also, you should use a key parameter to make sure you tell Struts2 which action gets which objects
read this official documentation for detail
Struts2 Scope Interceptor
I will prefer Scope Interceptor only when i have to develop a wizard like functionality as it will handle other things like session-level locking.
If this is not your requirement there are other way to pass parameters like putting object in Session and getting object from session at second action