Author |
Message |
14/04/2009 15:29:56
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 744
Offline
|
Hi,
I've a special question, as far as I know the Dispatcher extends a HashMap, which holds the managed beans by by class, so for each managed bean just one instance could exist in this map?
What happens, I've there are two rowincludes filled with the same kind of page, so referencing to the same managed bean properties? With replace content I can change the expression, but how the dispatcher manages this? Will there be a subdispatcher created?
regards
Markus
|
|
|
14/04/2009 16:23:37
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5521
Offline
|
Hi,
yes... the dispatcher manages one instance per class in its fabulous hash map. And you 100% see it the right way: the contentreplace is used for dynamic manipulation of bean names.
So, the question is how to arrange beans and expressions for two includes for the same class, but different beans.
Opening up a sub-dispatcher is possible, but in many cases is too complicated. I would try to work on one dipspatcher level as long as possible: otherwise you always have to CAREFULLY!!!!!!!!!!!!! pay attention to the level of dispatcher, that you currently (thiny you) are: if calling findDispatchedBean() then this only looks for the bean on one dispatcher level - not in the parent's dispatcher etc. etc.
So what you could do: assume you have "class Address" normally reachable via "#{d.Address}". You now want to see the address as "from"-address and as "to"-address in the same screen, 2*address.jsp.
So you could subClass "AddressFrom extends Address" and "AddressTo extends Address" (no further implementation). Then you include "address.jsp" with contentreplace:"Address:AddressFrom" and the other one with contentreplace "Address:AddressTo".
This is only one of (many) possibilities. It's really "just" playing with expression-manipulation on the one hand and dynamic bean access on the other hand...
Hope, this response helps...
Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
14/04/2009 16:36:44
|
mreich
Power User
Joined: 30/01/2009 08:34:23
Messages: 744
Offline
|
perfect, all my questions were answered!
|
|
|
|