Model object becomes null. Is there any change required for ModelDriven interface when upgrading from struts 2.3.35 to 2.5.26?

63 views Asked by At

Does migration from 2.3.35 to 2.5.26 needs any change to use ModelDriven interface?

I have an action class that implements ModelDriven interface. It was working fine with struts 2.3.35. After upgrading to struts 2.5.26, the model becomes null when we try to fetch it.

This is the reference code:

public class MyAction extends MyBaseAction
        implements ModelDriven<BulkModel>, ServletRequestAware, ServletResponseAware {

private BulkModel bulkModel;

public MyAction getModel() {
       if(null==bulkModel){
         bulkModel = new BulkModel();
       }
        return bulkModel;
}

public myMethod(){
System.out.println(bulkModel.getName());
}

}

I use both these interceptors for my action:

            <interceptor-ref name="scopedModelDriven" />
            <interceptor-ref name="modelDriven" />
0

There are 0 answers