Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

forEachToken

 
Sundar Murthi
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In HFS page 465 the core action given as <c:forEachToken> but in jstl spec they are given as <c:forTokens>.
<c:forEachToken> is not working it throw an exception

but <c:forTokens> is working fine.

its a bug in HFS?
 
Sami Sayeed
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
Thats an error in the book,
its c:forTokens, download the errata from www.wickedlysmart.com
<%
// this is just for a test, we must avoid to use scripting in jsps
String [] names={"one",two","three"};
request.setAttribute("names",names);
%>
<c:forTokens items="${names}" delims="," var="name">
${name}
</c:forTokens>
sami
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!