Solved

how do we use <logic:equal> tag?

Posted on 2004-04-01
5
14,694 Views
Last Modified: 2013-11-19
Hi,

I have code like this

<logic:iterate id="hdrVec" name="<%=WebConstants.MESSAGE_COUNTS_HDR %>" offset="0" length="1"  > <bean:write name="hdrVec" /> </logic:iterate>

Now i want use empty tag with in the <logic:iterate> tag

like
<logic:iterate id="hdrVec" name="<%=WebConstants.MESSAGE_COUNTS_HDR %>" offset="0" length="1"  > if this element is equal to "" then <bean:write name="hdrVec" /> else
just empty string i.e "" </logic:iterate>

please give me some code how do we use <logic:equal> tag in this scenario

thanks
0
Comment
Question by:mvkraju
  • 3
5 Comments
 
LVL 6

Expert Comment

by:jarasa
ID: 10732645
Something like this:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<!-- Is the number guess right? -->
<logic:equal parameter="number" value="7">
  You guessed right! You win a high speed blender!
</logic:equal>

<!-- If the number guessed was wrong -->
<logic:notEqual parameter="number" value="7">
  <!-- Less Than -->
  <logic:lessThan parameter="number" value="7">
         A little higher...
  </logic:lessThan>
  <!-- Greater Than -->
  <logic:greaterThan parameter="number" value="7">
         A little lower...
  </logic:greaterThan>
</logic:notEqual>

Javier
0
 

Author Comment

by:mvkraju
ID: 10733445
For the given example i used offset="0" length="1" in the <logic:iterate> tag
in that case i am retrieving the first element from the collection.

here i don't know the parameter name, just i know the what idex it is

So what will be the parameter in this case?

0
 
LVL 14

Accepted Solution

by:
kennethxu earned 20 total points
ID: 10734162
is this what you are looing for?

<logic:equal name="hdrVec" value="">
 dothis
</logic:equal>
<logic:notEqual name="hdrVec" value="">
 dothat
</logic:notEqual>
0
 

Author Comment

by:mvkraju
ID: 10734695
can i user offset and length attributes for the <logic:equal> tag?

if so i got solution for my problem.
0
 

Author Comment

by:mvkraju
ID: 10735227
<logic:equal name="hdrVec" value="">
 dothis
</logic:equal>

is working for me, just i need to put this logic between my <logic:iterate> tag
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

When you work with shopping cart / ecommerce relates web sites, you need to pass the certain form post details to the payment gateway process page with required details for the products items you give to order. Also you may need to track the ordered…
Article by: Matthew
I am a very big proponent of technology compliance standards and strive to meet such criteria in all of my work. That includes my site, which is 100% XHTML 1.0 compliant as determined by the World Wide Web Consortium. https://www.matthewstevenkel…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now