You'll most likely find that the "PortableRemoteObject.narrow()" will be 
the part giving you grief. The tags will have no idea that it has to do 
this. The fact that you can get away with it so easily with a small 
scriptlet will probably mean that it will remain your best option. Your 
problem is very specific and the tags are not designed to handle specifics.

Only other option, is to marshal from this EJB call into a basic bean 
within an Action before you forward to your JSP. Would also make the MVC 
purists happier. :)

What EJB container are you using that's running on top of VisiBroker?...


Arron.


Struts Newsgroup (@Basebeans.com) wrote:

>Subject: logic:iterate with EJB's, casting problem?
>From: "Nicolas Parisé" <[EMAIL PROTECTED]>
> ===
>Hi!
>
>I have a problems, for displaying a collection of object retrieved
>from a EJB (1.1).
>
>
>In my action class, I retrieve a collection of Artists objects from
>a Session EJB:
>
>
>Collection coll = myRemoteSessionBeanInterface.getArtists();
>request.setAttribute("coll",coll);
>
>then in my JSP, I use de iterate tag to loop over my collection :
>
>
><logic:iterate id="element" name="coll" type="Artists">
><bean:write name="element" property="name"/><br>
></logic:iterate>
>
>
>Here is the error that I have :
>
>javax.servlet.ServletException: com.inprise.vbroker.rmi.CORBA.ObjectImpl
>
>
>I was only be able to display my collection that way :
>
>Iterator it = coll.iterator();
>
>while (it.hasNext()) {
>    out.println(((Artist)PortableRemoteObject.narrow(it.next(),
>Artist.class)).getName());
>}
>
>
>I want to use the Struts logic:iterate tag, not the while loop, any ideas?
>
>
>
>
>Nicolas Parise
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to