how to express many to many items in jstl?

Hi,

I am using spring/hibernate annotation to do crud.

Citation class{
String citationName;
 Collection<Author> authorCollection;
}

Author class{
String lastName;
String middelName;
}

From my listcitation.jsp, I am trying to display citation records.
 <td><c:out value="${reference.citationName}" /></td>    
 <td><c:out value="${reference.authorCollection.lastName}" /></td>   <=== if I do this it bugs out.

Any idea?
dkim18Asked:
Who is Participating?
 
sweetfa2Commented:
Don't you need an index on your authorCollection?
0
 
dkim18Author Commented:
I guess you do something like this  but I am getting this error.

Someone mentioned about use fetch=.
Another mentioned creating entitymanage (which I don't know how to use it)
http://stackoverflow.com/questions/4263464/how-to-solve-lazyinitializationexception-not-using-fetch-fetchtype-eager

Any suggestions?


org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: org.battelle.bcho.refmgmt.domain.Referenceitem.authorList, no session or session was closed
      org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
      org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationExceptionIfNotConnected(AbstractPersistentCollection.java:350)
      org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:343)
      org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:86)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.