Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error in ArrayList in JSP

 
Mimi Tam
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
....


Questions:

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
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you add the JSTL taglib directive to your JSP?



Are the JSTL jars in WEB-INF/lib? Your code looks fine to me...
 
Mimi Tam
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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é
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, replace

with .

See this FAQ to understand why. (but this is probably not going to solve your problem)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic