Perhaps something like this:
//Session scoped backing bean
public class MyPojoManager{

private MyPojo pojo;

public MyPojo getPojo(){
if(pojo == null){
 //initialize the MyPojo object
}
return pojo;
}

}

This way it would only be initialized once.

- micke

2008/7/21 Guy Bashan <[EMAIL PROTECTED]>:

>  Hi,
>
>
>
> You will to excuse me for  this question, I have always worked with request
> scope beans:
>
> I have a screen in which details are being edited. Now, I have to add a
> button near one of the drop downs that will take me to a new screen,
> allowing me to create a new object and get back to the previous screen. Of
> course I will have to save the data in the first screen when moving to the
> second one and when returning data should be restored.
>
> So I thought setting my entity bean (hibernate pojo)  as a session bean,
> allowing me to store the state when moving from one screen to another. My
> question is: what mechanism can I use in order to initialize the entity
> bean. When going to the "create new object" screen I will want to "remember"
> the data, but when coming to the screen from some other place I will want
> the object to be either initialize, or to contain the data of a loaded
> object. I also don't want to start calculating from which screen or link I
> am coming to this screen in order to decide in which cases I have to
> initialize the object and in which not.
>
>
>
> Is there a neat way of doing it?
>
> Btw, I can't use Seam or some framework currently on this project.
>
>
>
> Thanks,
>
> Guy.
>

Reply via email to