This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Spring and the fly likes error in ArrayList in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "error in ArrayList in JSP" Watch "error in ArrayList in JSP" New topic

error in ArrayList in JSP

Mimi Tam
Ranch Hand

Joined: Mar 05, 2010
Posts: 121
Dear all,

I could not find exactly what I need to know in order to fix this problem. Hope someone can help me out.

In my Controller (names in code below changed for proprietary reasons):

In my JSP:

I got compile errors on my JSP:

Invalid attribute (items)
Invalid attribute (value)


Do I need to do .setAttributes for item, if so, how?
Is this the right way to pass an ArrayList to the View (from ModelAndView)?
Why am I getting these errors and how can they be solved?

Thanks very much in advance.

Lorand Komaromi
Ranch Hand

Joined: Oct 08, 2009
Posts: 276
Did you add the JSTL taglib directive to your JSP?

Are the JSTL jars in WEB-INF/lib? Your code looks fine to me...

OCJP 6 (93%)
Mimi Tam
Ranch Hand

Joined: Mar 05, 2010
Posts: 121
Thank you Lorand.

I have this as a separate file (include.jsp):

and I included it my JSPs that referenced these taglibs:

but its not working

Any other ideas would be greatly appreciated. Thanks!!!
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

First, replace

with .

See this FAQ to understand why. (but this is probably not going to solve your problem)

[My Blog]
All roads lead to JavaRanch
I agree. Here's the link:
subject: error in ArrayList in JSP
It's not a secret anymore!