• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with c:forEach  RSS feed

 
Evgenii Rybakov
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!

I have expression
c:forEach items="${searchObj.searchResult}" var="outer" begin="0"
body content
c:forEach
searchObj.searchResult - it's ArrayList's object.

I need to use attribute end of c:forEach tag.

How write this expression
end="%=searchObj.getSearchResult().size()-4%"
using only JSTL?

Thank you!
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As per forum instructions, we need to know what versions of JSP and JSTL you are using,
 
Evgenii Rybakov
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use version of JSP - 1.1 and JSTL -1.1
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please recheck, I doubt that you are using JSP 1.1 which is quite antiquated.

What server and version are you using? Tomcat 4? Tomcat 5?
 
Evgenii Rybakov
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I use JSP version 2.1. It's my misprint.
And I use Tomcat5.0.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat 5.0 supports JSP 2.0

There is a table (in blue) on the front of the Tomcat site where you can find version info.
http://tomcat.apache.org
[ November 15, 2006: Message edited by: Ben Souther ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so you're using JSP 2.0. It really is important to know what versions you are using.

Under JSP 2.0 and and JSTL 1.1, you use the fn:length function to determine the size of a collection (or string).

For example:



Be sure that you have declared the fn taglib.

Do you not have a copy of the JSTL Spec on your desk? If you don't you should.
 
Evgenii Rybakov
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.

Now i'm using JPS 2.0 but I couldn't decide my problem.

Look please my first I have problem with JSTL syntax. And understand forum instruction, but my problems don't depend on version server and JSP
 
Evgenii Rybakov
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh thank you Bear Bibeault for your answer,
and excuse me for my previous message.
Best regards!
 
Evgenii Rybakov
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh thank you Bear Bibeault for your answer,
and excuse me for my previous message.
Best regards!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!