tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Chris" <chrisjohn...@ti.com>
Subject RE: Nested expressions
Date Fri, 20 Aug 2004 16:55:26 GMT
I sent this before but never received it myself.  Then I sent another
one which wouldn't have made much sense without this one.  Gotta love
the internet (when it works).

-----Original Message-----
From: Johnson, Chris 
Sent: Friday, August 20, 2004 11:49 AM
To: 'Tag Libraries Users List'; 'nic.werner@sonoma.edu'
Subject: RE: Nested expressions


It never really makes sense to use OR when checking if more than one
thing is not-equal to another.  Try using AND instead, that is, if you
want to exclude both the 'view' and the 'perPage' params, which is what
it sounds like based on: "but stripping out two of the params."

-----Original Message-----
From: Nic Werner [mailto:nic.werner@sonoma.edu] 
Sent: Friday, August 20, 2004 11:34 AM
To: Tag Libraries Users List
Subject: Re: Nested expressions


You'd think it would, but JSTL is still allowing them to pass through. 
Anyone want to point out where I'm just missing this?

This code is generating the url string to be used later, but stripping 
out two of the params. If I don't use the OR, one will always strip out,

but put it in and it ignores it.

<c:forEach items="${param}" var="params" varStatus="status">
    <c:if test="${params.key != 'view' || params.key != 'perPage'}">
        <c:set var="url"><c:out 
value="${url}&${params.key}=${params.value}" escapeXml="false"/></c:set>
        <c:out value="${params.key}=${params.value}" escapeXml="false"/>

<%-- Output to test --%>
    </c:if>  
</c:forEach>

Any suggestions guys? You've never failed me before!

Thanks,

- Nic.


Derek wrote:

> You were on the right path.  This should do it...
>
> <c:if test="${params.key != 'view' || params.key != 'perPage'}">
>
> Derek
>
>
> On Aug 19, 2004, at 7:47 PM, Nic Werner wrote:
>
>> I'm sure I'm just looking at this the wrong way, and I can't find it 
>> in Shawns book, but I want to evaluate two variables with an OR
>> condition:
>>
>> <c:if test="${params.key != ('view' || 'perPage')}">
>>
>> Basically, if params.key doesn't equal  the words 'view' or 
>> 'perPage', go ahead.......
>>
>> What am I doing wrong here?!
>>
>> Thanks,
>> - Nic
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message