Hi all,

           I am using my custom model with trinidad table as shown below. I
want to instantiate my custom model only once regardless of backing bean. Is
it possible?

*Model Class:*

public MyModel extends CollectionModel {

    // logic
}


*Backing Bean:*

public MyBackingBean {

        private MyModel  model;

         public MyBackingBean() {
             model = new Model(/*some collection */);
         }

          public MyModel  getModel() {
                return model;
           }

}
*
JSP page:*

<tr:table value="#{myBean.model}" .....>


*The backing bean is in request scope.*

*
Problem:*

Since the backing bean is in request scope, for every request new instance
of model is created. I don't want to create new instance of my custom model
since i am storing some state in it. Is there any way to create only one
instance of  custom model regardless of backing bean scope, like trinidad
creates only one instance of SortableModel.



-- 
Thanks and Regards
Ravindra Adireddy

Reply via email to