logic OR option available / not in struts

Discussions

Web tier: servlets, JSP, Web frameworks: logic OR option available / not in struts

  1. logic OR option available / not in struts (2 messages)

    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.

    Threaded Messages (2)

  2. 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
  3. I want alternate[ Go to top ]

    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.