Your two options are:

Option 1:
  <logic:equal name="user_role" value="guest">
    <%-- do something --%>
  </logic:equal>
  <logic:equal name="user_role" value="temp">
    <%-- do same thing --%>
  </logic:equal>

Option 2:
  Write a method in your form bean that returns true iff the value
  of "user_role" is "guest" or "temp".  Then, in your JSP,
  <logic:equal name="form-bean-name" 
      property="role-tester-method"
      value="true">
    <%-- do something --%>
  </logic:equal>


Sri
-----Original Message-----
From: Rajendra Kadam [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 31, 2003 4:05 PM
To: Struts-User
Subject: How to do ORing using struts:logic Tag


Hi,
 
I'm using struts 1.0.
 
Here is the case that I want to do OR two conditions. 
 
For Eg. like this
 
If ( user_role.equal("guest") || user_role.equals("temp") )
{
    then do something....
}
 
How should I do it.
 
if I try to use struts:logic tag, I'm unable to make it.
Doing this ->
    <logic:equal name="user_role" value="guest">
     <logic:equal name="user_role" value="temp">
        .......
    </logic:equal>
   </logic:equal>
 
This gives me AND conditions.
 
Is there any way I can OR  the conditions ?
 
Pls help me out in this case.
 
raju

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to