You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Laufer, Michael" <mi...@entory.com> on 2000/11/24 12:41:10 UTC

logic:equal help ?!?

Hi,

I've just started with the logic-library of the Struts framework
I'm using the following code to create a dynamic html-table:

<struts:iterate id="ruleForm" name="ruleForm" property="allRules">
  <tr>
    <td class="iterate">
		<logic:equal name="ruleForm" property="isActive"
value="true"/>true</logic:equal>    
	</td>
    <td class="iterate">
      <struts:htmlProperty name="ruleForm" property="rulename"/>
    </td>
    <td class="iterate">
      <struts:htmlProperty name="ruleForm" property="attribute"/>
    </td>
    <td class="iterate">
      <struts:htmlProperty name="ruleForm" property="operator"/>
    </td>
    <td class="iterate">
      <struts:htmlProperty name="ruleForm" property="comparison"/>
    </td>
    <td class="iterate">
      <struts:htmlProperty name="ruleForm" property="mapping"/>
    </td>
  </tr>
</struts:iterate>

No I'm facing the following problem:
my
<logic:equal name="ruleForm" property="isActive" value="true"/>rule
true</logic:equal>   
code seems not to work correctly.
My impression is that it doesnt compare the property "isActive" with the
value "true".Because I'm always getting the text "rule true" in my table.
Am I using the equal-tag not correctly or am misunderstanding here something
terribly ??

Any help would be appreciated.
Thanks in advance.

Mike





Re: logic:equal help ?!?

Posted by Pierre Métras <ge...@sympatico.ca>.
logic:equal help ?!?Hi Michael,

That's a classic: <logic:equal name="ruleForm" property="isActive" value="true"/>rule true</logic:equal>

Remove the / from your opening tag and everything will work as expected. The XML parser is not smart enough to complain that it encountered a closing tag without opening...
But take care that the comparison will try to check for String comparison, and not the boolean true...

Pierre Métras

  ----- Original Message ----- 
  From: Laufer, Michael 
  To: 'Struts' 
  Sent: Friday, November 24, 2000 6:41 AM
  Subject: logic:equal help ?!?


  Hi, 

  I've just started with the logic-library of the Struts framework 
  I'm using the following code to create a dynamic html-table: 

  <struts:iterate id="ruleForm" name="ruleForm" property="allRules"> 
    <tr> 
      <td class="iterate"> 
                  <logic:equal name="ruleForm" property="isActive" value="true"/>true</logic:equal>    
          </td> 
      <td class="iterate"> 
        <struts:htmlProperty name="ruleForm" property="rulename"/> 
      </td> 
      <td class="iterate"> 
        <struts:htmlProperty name="ruleForm" property="attribute"/> 
      </td> 
      <td class="iterate"> 
        <struts:htmlProperty name="ruleForm" property="operator"/> 
      </td> 
      <td class="iterate"> 
        <struts:htmlProperty name="ruleForm" property="comparison"/> 
      </td> 
      <td class="iterate"> 
        <struts:htmlProperty name="ruleForm" property="mapping"/> 
      </td> 
    </tr> 
  </struts:iterate> 

  No I'm facing the following problem: 
  my 
  <logic:equal name="ruleForm" property="isActive" value="true"/>rule true</logic:equal>   
  code seems not to work correctly. 
  My impression is that it doesnt compare the property "isActive" with the value "true".Because I'm always getting the text "rule true" in my table.

  Am I using the equal-tag not correctly or am misunderstanding here something terribly ?? 

  Any help would be appreciated. 
  Thanks in advance. 

  Mike