Please help me.
Is there any possibility to write OR option in struts.
I am giving the context here under.
<logic:present name="list1">
<logic:present name="list2">
.......................
</logic:present>
</logic:present>
The above conditions tell us as it is a AND operation.
Like-wise I want OR operation to check whether whether list1 OR list2 is present or not.
-
logic OR option available / not in struts (2 messages)
- Posted by: kishore kumar
- Posted on: August 24 2004 07:02 EDT
Threaded Messages (2)
- logic OR option available / not in struts by Rene Zanner on August 24 2004 08:23 EDT
- I want alternate by kishore kumar on August 26 2004 07:03 EDT
-
logic OR option available / not in struts[ Go to top ]
- Posted by: Rene Zanner
- Posted on: August 24 2004 08:23 EDT
- in response to kishore kumar
Hi,
you have to simulate the OR - e.g. by defining some flag. The following is an exclusive OR implementation (it's only true if exactly one of both lists is present):
<bean:define id="XOR_CONDITION" value="false"/>
<logic:present name="list1">
<logic:notPresent name="list2">
<bean:define id="XOR_CONDITION" value="true"/>
</logic:notPresent>
</logic:present>
<logic:present name="list2">
<logic:notPresent name="list1">
<bean:define id="XOR_CONDITION" value="true"/>
</logic:notPresent>
</logic:present>
<logic:equals name="XOR_CONDITION" value="true">
.......................
</logic:equal>
Hope that helped,
René Zanner -
I want alternate[ Go to top ]
- Posted by: kishore kumar
- Posted on: August 26 2004 07:03 EDT
- in response to Rene Zanner
Hi,
I am thankful to your reply.
By your reply I have to write block of statements twice. If the statement block is large ,, the page too length. Is there any alternate to write OR in one condition (it means write block of statements once only).
I hope the reply.