----- Original Message -----
From: "Shawn Bayern" <[EMAIL PROTECTED]>
To: "marba" <[EMAIL PROTECTED]>
Sent: Tuesday, April 09, 2002 6:36 PM
Subject: Re: how can I compare strings in c:if


> On Tue, 9 Apr 2002, marba wrote:
>
> > > Make sure that the two strings in your database don't have different
> > > amounts of whitespace, are indeed of the same case (uppercase,
lowecase,
> > > etc.), and so on.  I often find it useful to print out values with a
> > > marker (e.g., the ' character) on both sides to make sure I'm not
missing
> > > any whitespace.
> >
> > Also tryed comparing two fields from a "sef" join (select * from A
> > left join A) but they evaluate different. Your code runs OK. Any hint?
>
> Did you try printing out both strings to ensure they're equal?
>
> Shawn
>
I tryed printing even the fields surrounded by apices (') as you suggested.
Anyway being the same field repeated in the self join it should be
equal.(and it prints equal)

I think i guess the problem with this code:

<c:set var ="x" value="${row.columns[i + campi]}"/>
<c:set var ="y" value="${row.columns[i]}"/>

    <c:if test="${x < 'y'}">
              <c:out value="minore"/>
    </c:if>

    // this is OK

    <c:if test="${x < y}">
              <c:out value="minore"/>
    </c:if>

    this last causes an exception:

javax.servlet.ServletException: Attempt to apply operator "<" to arguments
of type "org.apache.taglibs.standard.tag.common.sql.ColumnImpl" and
"org.apache.taglibs.standard.tag.common.sql.ColumnImpl"

I guess if the compiler does'nt coerce x and y to String they don't evaluate
equal.


Marco




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to