You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by albert kao <al...@gmail.com> on 2017/11/06 00:42:32 UTC

scopedModelDriven and ScopedModelDrivenInterceptor

I am a Struts2 beginner.
I saw the scopedModelDriven and ScopedModelDrivenInterceptor mentioned in
chapter 14 "Migration from Struts Classic" in the "Struts 2 in  Action"
book by "Donald Brown, ...".

The Struts2 documentation said:

"public interface ScopedModelDriven<T>
extends ModelDriven
<https://struts.apache.org/maven/struts2-core/apidocs/com/opensymphony/xwork2/ModelDriven.html><T>

Adds the ability to set a model, probably retrieved from a given state."

Are scopedModelDriven and ScopedModelDrivenInterceptor used for mainly
for "Migration
from Struts Classic"?
If not, please provide more explanation and source code examples.
Thanks.

Re: scopedModelDriven and ScopedModelDrivenInterceptor

Posted by Yasser Zamani <ya...@live.com>.

On 11/6/2017 4:12 AM, albert kao wrote:
> please provide more explanation and source code examples.

I think it is like ModelDriven but in ModelDriven you can have the model 
only in that action but in ScopedModelDriven you can have the model 
shared between actions in larger scopes `request` (default) or 
`session`. For example [1].

[1] 
https://www.experts-exchange.com/questions/26478728/Struts2-scopedModelDriven.html