Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL forEach for ArrayList question  RSS feed

 
Sam Cheng
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following mistake happen when I use JSTL, whether please do me a favor by the older generation.
"org.apache.jasper.JasperException: /Test.jsp(33,8) According to TLD or attribute directive in tag file, attribute items does not accept any expressions
"

After servlet end collects the materials with ArrayList, convey session to jsp to receive


After JSP is received with the following JSTL, play selecting in the form under putting one



[ August 10, 2005: Message edited by: Sam Cgeng ]
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make sure you have these at the top of your page:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

and NOT this:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to the JSP forum..
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
make sure you have these at the top of your page:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


This is true if, and only if, you are using JSTL 1.1 with a JSP 2.0 container.

If Sam is using a JSP 1.x container, the problem will lie elsewhere.

So Sam, what JSP version and JSTL version are you running?
 
Sam Cheng
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I establish according to the method of Ola Daniel, the problem has already been solved, thank you!

Bear Bibeault,The container that I used is Tomcat 5.0, the problem has already been solved now, thank you for your answers!
[ August 10, 2005: Message edited by: Sam Cgeng ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
he container that I used is Tomcat 5.0


Yes, As Tomcat 5 is a JSP 2.0 container, Ola's answer is correct. The URI he provided references the JSTL 1.1 (as opposed to the JSTL 1.0) which is what should be used with JSP 2.0.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!