Solved

how do we use <logic:equal> tag?

Posted on 2004-04-01
5
14,695 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

895 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

13 Experts available now in Live!

Get 1:1 Help Now