Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OR condition implementation using logic:equal

I am new to struts and I was thinking if we can implement OR and AND conditions with struts logic:equal? if not then what are the alternatives.

like image 871
Sandeep Kumar Avatar asked Nov 20 '25 23:11

Sandeep Kumar


2 Answers

for AND like if(Column1 == "1" && Column2 == "2") { .... }

you can use :

<logic:equal name="urList" property="Column1" value="1">
  <logic:equal name="urList" property="Column2" value="2">
  doSomeThing
  </logic:equal>
</logic:equal>

or for 'OR' :

<logic:equal name="urList" property="Column1" value="1">
  doSomeThing
</logic:equal>
<logic:equal name="urList" property="Column2" value="2">
  doSomeThing
</logic:equal>

sry for bad english.

like image 80
SwT Avatar answered Nov 22 '25 13:11

SwT


You can use EL with Strut's taglib. You can also use JSTL (c:if in this case).

like image 42
Sergio Nakanishi Avatar answered Nov 22 '25 13:11

Sergio Nakanishi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!