Re: [Actionframework-users] using invoke
Status: Inactive
Brought to you by:
ptoman
From: Petr T. <Pet...@pi...> - 2002-08-09 18:52:38
|
> <template name="/displayObject.vm"> > <invoke component="session" > method="storeSession(Context context, Object $typeID)"/> > <output-variable name="objectList" component="objectManager" > value="getDefaultList($typeID)"/> > </template> > > i have yet to figure out how to pass the actual name of the parameter > to the storeSession() method, but i get an error indicating that the > dtd defines template contents as "(output-variable*,invoke*)", the > "," forcing the order, instead of a "|". > > is there a technical reason for this, or just a preferred way of > doing it. i don't see any reason to FORCE the invoke elements after > the output-variable elements, if you put it before, then one just > has to assume that variables defined in the output-variable elements > won't be available yet. if its after, then they will. or am i > missing something? The reason why <template>'s <output-variable>s are placed before <invoke> is that you can nest another set of <output-variables>s inside <invoke> (and override values or whatever): <template name="/displayObject.vm"> <invoke component="session" method="storeSession(Context context, Object $typeID)"> <output-variable name="objectList" component="objectManager" value="getDefaultList($typeID)"/> <invoke> </template> In addition, <invoke> behaves almost exactly as <action> and may also retrieve values from request (or set them by <input-variable>). Does this satisfy your requirements? Of course, if there is a demand, <output-variable>s could be allowed also after <invoke>s... your opinions, gentlemen? :) Petr -- [ http://dione.zcu.cz/~toman40 - Pet...@pi... - ICQ=22957959 ] |