I have 2 pages. The page 1 will transfer some data into page 2 so i have to use session scoped for bean in page 1. In page 2, i have to change some data which will influence data in page 1. But i go back page 1, the data is still not change. If i use View scope in page 1 i cannot transfer into page 2. Please help me do!
SInce bean1 seems to be the base bean for this workflow and bean2 is a modifier of it, the easiest way to handle that is to inject bean1 into bean2 and let the bean2 page do what it needs, passing the results back to the injected bean1. In a case like that, putting bean2 in View scope should work, and probably you'll want a @PostConstruct method to pre-configure bean2 based on bean1's properties. For older systems where @PostConstruct didn't work, we had to kind of hack things, since there was no clear method call for the time where the managed properties were all set but nothing was yet being fetched for display.
In some cases, you need a more permanent connection running both ways. In that case, make both beans be session scoped, inject bean2 into bean1 and code the bean2 to set itself into the bean1 using a "setBean2" method that you add to bean1. You would probably do this in the bean2 "setBean1 method.
"privilege" comes from the Latin words for "private" and "law" (legal) and dates to feudal times. To "claim privilege" meant that you were above the laws that applied to the common people.
It's a beautiful day in this neighborhood - Fred Rogers. Tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book