Link to home
Start Free TrialLog in
Avatar of dkim18
dkim18

asked on

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?
Avatar of dkim18
dkim18

ASKER

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)
ASKER CERTIFIED SOLUTION
Avatar of sweetfa2
sweetfa2
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial