this is a very basic application of the JavaBeans spec, and I don't really
think you should read it to use in jstl. You just need to know that any
class with non-static methods starting with "get", "set" or "is" (this last
one only for booleans) is a JavaBean to you. Then, to call this method,
remove the prefix and lowercase the first letter after it. Unless there are
more than one uppercase letters, so:

getId() -->  .id
getID() -->  .ID

In most EL tutorials you'll find this better explained, I'd start with Shawn
Bayern's book, JSTL in Action, probably the best there is for JSTL.

-----Original Message-----
From: Keith [mailto:[EMAIL PROTECTED]
Sent: 12 April 2004 18:57
To: Tag Libraries Users List
Subject: RE: isLast() method of LoopTagStatus class


Perfect! Thanks!

Where would I have looked to find that info? I'm still really new to Beans
and raw Java 
code. Main reason why I'm going with JSTL right now. I had tried looking in
the Java 
Docs, but I really didn't know where to begin. 

Keith

---------- Original Message -----------
From: Felix Velasco <[EMAIL PROTECTED]>
To: "'Tag Libraries Users List'" <[EMAIL PROTECTED]>
Sent: Mon, 12 Apr 2004 18:41:51 +0200
Subject: RE: isLast() method of LoopTagStatus class

> try loop_status.last instead of loop_status.isLast(). EL will translate it
> as per javabeans specification
> 
> -----Original Message-----
> From: Keith [mailto:[EMAIL PROTECTED]
> Sent: 12 April 2004 18:41
> To: Taglibs
> Subject: isLast() method of LoopTagStatus class
> 
> I'm trying to output a comma delimited list based on a varying list of
> statuses that will 
> be input from a select menu in a form. I was trying to figure out how to
> avoid putting a 
> comma after the last value, and it seemed like testing with the isLast()
> method of the 
> LoopTagStatus class would be a good thing to use. I'm not quite sure how
to
> go about 
> using it, though. Reading about it, it looks like the 'varStatus'
attribute
> of the 
> <c:forEach> tag creates a variable to hold a LoopTagStatus object. My code
> below was how 
> I assumed I would then be able to access the isLast() method:
> 
> <%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>
> <%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"; %>
> <c:forEach items="${paramValues.status}" var="status_row"
> varStatus="loop_status">
>     '${status_row.status_name}'
>   <c:if test="${!(loop_status.isLast())}">, </c:if>
> </c:forEach>
> 
> But when I do this, I get the following error back:
> 
> org.apache.jasper.JasperException: /report_status_data.jsp(20,3) The
> function isLast must 
> be used with a prefix when a default namespace is not specified
> 
> Here's an example of the kind of output I'm trying to generate. The list
has
> a 
> possibility of being shorter or longer than this:
> 
> 'In-Progress', 'Closed', 'Terminated', 'Withdrawn'
> 
> Thanks in advance!
> 
> Keith
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
------- End of Original Message -------


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

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

Reply via email to