Solved

how do we use <logic:equal> tag?

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Web Development Tools for MVC 3 92
how to extract window origin in spring 2 71
Question on web subscription for apps 3 109
Form submit issue 11 85
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

832 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