Hi,

I think I found another bug with the String taglib, though probably rarely
would this come up. I have found that if I use the substring on more that
one element in the JSTL forEach loop where the start and end values are the
same with both substring tags I then get the same behaviour as I did before.

The code:

...

Result r = ResultSupport.toResult(dataBase.getAllUsers(name, location,
activity));
  pageContext.setAttribute("r", r);

...

<c:forEach items="${r.rows}" var="value" varStatus="status"
begin="${param.begin}" end="${param.begin + perPage -1}">
....

<td><str:substring start="0" end="3"><c:out
value="${value.name}"/></str:substring>&nbsp;</td>
  <td><str:substring start="0" end="3"><c:out
value="${value.lastName}"/></str:substring>&nbsp;</td>

....

</c:forEach>

I am ok, but I thought it would be of interest to you.

Thanks again,

Stef

----- Original Message -----
From: "Henri Yandell" <[EMAIL PROTECTED]>
To: "Tag Libraries Users List" <[EMAIL PROTECTED]>
Sent: Sunday, October 13, 2002 8:22 PM
Subject: JSTL in Java Was: Is there a way to call java.lang.String.substring
on a <c: ou t ?


>
>
> On Sat, 12 Oct 2002, Stefan wrote:
>
> > I just decided recently to finally look at using taglibs. For the last
> > couple of years I have been fine with using <%= %> that processed bean
> > methods that return strings. But now seeing how many taglibs there are
out
> > there, I decided it was time to jump in. Now if I can figure out why I
can't
> > use the results of a taglib as an arguement for a method in a Java bean?
> >
> > Example:
> >
> > <%= my.myMehtod(<c:out value='${value.location}'/>);%>
>
> Effectively what you have here is a piece of the JSTL inside Java scope.
> <%= ... %> has the ... being Java code, not JSP. At least that's how I
> look at it, the bug in String taglib shows that I've still got some
> understanding to do on the Taglib lifecycle.
>
> I'd not thought of the order in which scriptlets/taglibs are executed, I
> think because I tennd to use them by instinct/experience and don't think
> of the why's etc. Hopefully someone else knows the spec and
> realities better.
>
> > What I have noticed is that scriptlets seem to get ouputted before
taglibs
> > ... or the reverse, I forget which way. What ever it may be, the above
> > sample code would have the tag been passed as a string; that is "<c:out
> > value='${value.location}'/>" instead of the output of the tag. So I
guess
> > scriptlets gets process before, right?
> >
> > Thanks again,
> >
> > Stef
> >
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


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

Reply via email to