struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Hill" <andrew.david.h...@gridnode.com>
Subject RE: if condition with "or"
Date Thu, 05 Dec 2002 07:08:21 GMT
<snip>
what is the difference between having a scriptlet or what you use above?
</snip>

Hehe I rather agree Jim!
(Mind you I am rather anti-JSP so my view is probably a bit biased!)

Your question reminds me of an old article I read several months ago by
Jason Hunter (author of the O'Rielly Servlet book) written back at the dawn
of time (or to be more precise in the year 2000).
http://www.servlets.com/soapbox/problems-jsp.html

The quote that stuck in my mind was:
<snip>
Someday there will be custom tags for doing these loops. And custom tags for
"if" checks too. And JSP pages may look like a grotesque Java reimplemented
with tags
</snip>

Hmmm??????

<c:if test="${(count == 0) || (count == 2) || (count == 4)}">
   ... do something ...
</c:if>






-----Original Message-----
From: Jim Collins [mailto:james.collins@blueyonder.co.uk]
Sent: Thursday, December 05, 2002 14:29
To: Struts Users Mailing List
Subject: Re: if condition with "or"



----- Original Message -----
From: "Craig R. McClanahan" <craigmcc@apache.org>
To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
Sent: Thursday, December 05, 2002 12:20 AM
Subject: Re: if condition with "or"


>
>
> On Wed, 4 Dec 2002, Jana Navaneethan wrote:
>
> > Date: Wed, 4 Dec 2002 17:23:42 -0500
> > From: Jana Navaneethan <jana.navaneethan@labs.gte.com>
> > Reply-To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> > To: Struts Users Mailing List <struts-user@jakarta.apache.org>
> > Subject: if condition with "or"
> >
> > Hi,
> >       I want to use <logic:equal> in my JSP to replace the following
code.
> >
> > if  (count = 0 || count = 2 || count = 4)
> > do something.....
> >
> > How to achieve this using <logic:equal> By the count is index value of
the
> > iterator i.e indexId.
> >
>
> This is one of the very large number of reasons that you should start
> using JSTL if you can (i.e. you're on a Servlet 2.3/JSP 1.2 or later
> container):
>
>   <c:if test="${(count == 0) || (count == 2) || (count == 4)}">
>     ... do something ...
>   </c:if>
>
Hi Craig I remember seeing one of you posts where you say you are against
having java code in a JSP but what is the difference between having a
scriptlet or what you use above?

Regards

Jim.
>
> > Thanks in advance,
> > Jana.
> >
>
> Craig
>



--
To unsubscribe, e-mail:
<mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message