Re: Obtaining size of java.util.Collection through Struts/JSTL

2005-04-05 Thread Matt Raible
Greg Pelly wrote:
What is the prefered way to obtain the size of elements that implement the
Collection interface, such as a Vector?  I would like something like:
 elements exist in
this Vector!
But since the method is called "size()" and not "getSize()," Struts can't
handle it.  Right now I am using scriptlets:
<%
 java.util.Vector v = request.getAttribute("myVector");
%>
...and later...
<%= v.size() %> elements exist in this Vector!
Any advice?
Greg
 


Source: http://raibledesigns.com/page/rd?anchor=struts_tip_o_the_day
Matt

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


Re: Obtaining size of java.util.Collection through Struts/JSTL

2005-04-05 Thread Robert Taylor
Make sure you include:
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"; prefix="fn" %>


/robert
Greg Pelly wrote:
What is the prefered way to obtain the size of elements that implement the
Collection interface, such as a Vector?  I would like something like:
 elements exist in
this Vector!
But since the method is called "size()" and not "getSize()," Struts can't
handle it.  Right now I am using scriptlets:
<%
  java.util.Vector v = request.getAttribute("myVector");
%>
...and later...
<%= v.size() %> elements exist in this Vector!
Any advice?
Greg
-
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]


Re: Obtaining size of java.util.Collection through Struts/JSTL

2005-04-05 Thread Erik Weber
I use bean:size. I don't know if there is a JSTL equivalent. Seems odd 
that there wouldn't be one, but I can't find one in my JSTL reference.

Erik
Greg Pelly wrote:
What is the prefered way to obtain the size of elements that implement the
Collection interface, such as a Vector?  I would like something like:
 elements exist in
this Vector!
But since the method is called "size()" and not "getSize()," Struts can't
handle it.  Right now I am using scriptlets:
<%
 java.util.Vector v = request.getAttribute("myVector");
%>
...and later...
<%= v.size() %> elements exist in this Vector!
Any advice?
Greg
-
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]


Obtaining size of java.util.Collection through Struts/JSTL

2005-04-05 Thread Greg Pelly
What is the prefered way to obtain the size of elements that implement the
Collection interface, such as a Vector?  I would like something like:

 elements exist in
this Vector!

But since the method is called "size()" and not "getSize()," Struts can't
handle it.  Right now I am using scriptlets:
<%
  java.util.Vector v = request.getAttribute("myVector");
%>

...and later...

<%= v.size() %> elements exist in this Vector!

Any advice?

Greg

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