• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach&gt

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am new to spring, am displaying a list from database based on id using spring mvc, but in my jsp, I have this error javax.servlet.jsp.JspTagException: Don't know how to iterate over supplied "items" in <forEach>,

here is my controller code



here is my jsp



here in jsp, in my eclipse it is showing undefined attribute name <table width="75%" height="100" name="jobList" border="0" cellpadding="2">, may be because of that am getting this error, I really don't know, how do I get these values into my jsp... Can anyone help me out??


Thanks in advance
Lissy.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure if this can help.

But

public ModelAndView List(WebRequest request,@PathVariable String id, Model model) throws Throwable {

How is that a legal method.

1) List, that is the name of a Java built in Interface
2) List, method names start with a lower case letter.
3) List is a reserved keyword that should never be used as a name for a method.

Also

<c:forEach var="o" items="${jobList}">

jobList is a ListItem type, shouldn't it be a Collection object in order to forEach it. I don't think jobList instanceof Collection.

Or the fact that jobList doesn't even contain your list of JobList objects. list1 is not added in any way shape or form to jobList. so jobList just has partNo, serialNo, Job_current_state (Why the underscores, that isn't Java like) job_type and transaction_id only.

Mark
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic