You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/05/13 07:40:01 UTC
logic:iterate with EJB's, casting problem?
Subject: logic:iterate with EJB's, casting problem?
From: "Nicolas Paris�" <ni...@globetrotter.net>
===
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
NEVERMIND: Form Problem (This should be simple)
Posted by Phase Web and Multimedia <ma...@phase.ws>.
I guess all I had to do was make sure that the request was the specified
scope for the ActionForm. I thought it was default. :-) My bad.
-----Original Message-----
From: Phase Web and Multimedia [mailto:mail@phase.ws]
Sent: Monday, May 13, 2002 1:03 AM
To: Struts Users Mailing List
Subject: Form Problem (This should be simple)
This should be simple.
I have a page, PAGE A, and another page, PAGE B.
when I enter the url www.mydomain.com/do/pagea
it takes me to a page with a some input form elements and two buttons
I click a button then I am sent to another page (PAGE B)
On "PAGE B" I have a link back to "PAGE A"
When I click the link back to "PAGE A" my form information continues to
persist. Why is this? I thought the form lived in the request. It shouldn't
be getting forwarded around... right?
I click refresh nothing happens. It is not a browser cached page. It seems
like the form is persisting in thre request for some reason. I am running
struts 1.1b1 with Tomcat 4.0.3. Any thoughts?
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Form Problem (This should be simple)
Posted by Phase Web and Multimedia <ma...@phase.ws>.
This should be simple.
I have a page, PAGE A, and another page, PAGE B.
when I enter the url www.mydomain.com/do/pagea
it takes me to a page with a some input form elements and two buttons
I click a button then I am sent to another page (PAGE B)
On "PAGE B" I have a link back to "PAGE A"
When I click the link back to "PAGE A" my form information continues to
persist. Why is this? I thought the form lived in the request. It shouldn't
be getting forwarded around... right?
I click refresh nothing happens. It is not a browser cached page. It seems
like the form is persisting in thre request for some reason. I am running
struts 1.1b1 with Tomcat 4.0.3. Any thoughts?
Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: logic:iterate with EJB's, casting problem?
Posted by Arron Bates <ar...@pacific.net.au>.
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é" <ni...@globetrotter.net>
> ===
>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: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>