i want to use if else statement in OGNL
scenario:
i have 3 input parameters .i have to run an action for 3rd input with help of input 1 and input 2.
i have to pass input 1 or input 2 to the action item which is added in input 3.
kindly help me with ONGL expression to get the desired output.
Hi,
Something like the following OGNL should work. In this particular example, it will call the action, passing the value of input1 if it is not null, otherwise passing the value of input2. Of course, you can change the condition to be something else, depending on your use case.
GetAction("com.foo.bar","myaction").call( (#input1 != null) ? #input1 : #input2 )
Hi,
Something like the following OGNL should work. In this particular example, it will call the action, passing the value of input1 if it is not null, otherwise passing the value of input2. Of course, you can change the condition to be something else, depending on your use case.
GetAction("com.foo.bar","myaction").call( (#input1 != null) ? #input1 : #input2 )
Thanks llian llive...It worked for me ..