----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 14, 2003 9:19 PM Subject: [OS-webwork] expression language+value stack
> question, how can I use the value stack in a method invocation in EL? > > I want to do something like the following: > <ww:property value="@myBean"> > <ww:property value="foo('.')" /> > </ww:property> > > what is the correct way (if any) to be able to invoke methods > using arguments off the value stack? > Sure you can invoke methods using arguments from the stack. You use the "." notation for the current value and ".." for the parent value, so you could write: <ww:property value="@someAction/foo(.)"/> This would call the method foo in someAction with the current stack value as parameter. In your example you first push @myBean on the stack. Is that because you want to use it as a parameter, or because the foo method exists in it? I assume it is because you want to use it as a parameter, and that the foo method is declared in the action that led to this view. Your example would then become: <ww:property value="@myBean"> <ww:property value="foo(.)" /> </ww:property> But since you obviously already have used the id tag to store myBean in the page/request context you might as well skip the push and just write: <ww:property value="foo(@myBean)"/> Cheers, Dick Zetterberg [EMAIL PROTECTED] ------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps1 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork