I am still learning about EJBs, Struts, and a whole host of other things.  I'm writing 
a simple web app to manage my product license keys.  I have 3 CMR EJBs that I'm 
working with:  ProductVendor, Product, and LicenseKey.  The beans are created such 
that a ProductVendor can have multiple Products, each of which can have multiple 
LicenseKeys.  
 
In my web app, I would like to be able to list all of the entries in my database.  In 
my Struts Action, I perform a findAll() to return a Collection of ProductVendors, and 
then call request.setAttribute("vendorList", vendors); so it can be referenced from my 
JSP.
 
In my JSP, I have the following to iterate over the list and display the entries:

<logic:iterate id="vlist" name="vendorList">

<bean:write name="vlist" property="name" />

<ul>

<logic:iterate id="plist" name="vlist" property="products">

<li><bean:write name="plist" property="title" /></li>

</logic:iterate>

</ul>

</logic:iterate>

 

Everything looks like it is in order.  However, when I try to display the JSP I get 
the following exception:  org.apache.jasper.JasperException: A CMR collection may only 
be used within the transction in which it was created.

Can anyone explain to me what the problem is?  Does anyone know how I could go about 
displaying the list like I would like?  I'd really appreciate any help you could give 
this poor newbie.  Thanks in advance!

 

Steve Nakhla



---------------------------------
Do you Yahoo!?
Free Pop-Up Blocker - Get it now

Reply via email to