[jboss-user] [EJB 3.0] - Which approach to fully access EJB3 Entities from within JSP

icordoba do-not-reply at jboss.com
Fri Jun 15 21:08:39 EDT 2007


Hi there,
after reading lots of posts trying to find a solution to access EJB3 Entity beans from JSTL I haven't been able to get a valid approach.
I can't use Lazy loading as that would make my JSP need a scriptlet to make a UserTransaction surround all data access.
When using Eager loading, I have to make all data be returned as Set's, and not Lists or Collections (solutions for this involve Hibernate specific annotations, outside EJB 3 standard; I want to stick to EJB3 I've also found very "ugly" using @IndexColumn or @ColumnId Hibernate annotations).
As I just said, and because I am using Struts, the only solution I've found is attaching EJBs in the request/session with there relations as Set types. This works but I have a big small problem. I can't access data using Expression Language. For example, I am getting a:
Unable to find a value for "0" in object of class "org.hibernate.collection.PersistentSet" using operator "[]"
When trying to do:
${newsArticle.textBlocks[0]}

Can anybody thing of an approach to be able to access EJBs in JSP pages without any limitations, conforming to EJB3 standard and without using scriptlets in my page? (Of course working with JBoss).

I can't believe that such a simple goal is not actually possible with JBoss (and maybe other AS's) implementation of EJB3.

Thanks for any help,
Ignacio

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4054931#4054931

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4054931




More information about the jboss-user mailing list