You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Giampiero De Ciantis <gi...@hotmail.com> on 2003/06/11 19:07:36 UTC

Using ActionForms and Entity CMP EJB

I have an EJB that returns a collection of categories (Strings) that I want
to display on my page as links. I can't seem to figure out what the pattern
is for bringing a Collection object from the data-tier to the Web-Tier using
Struts.

Thanks

-Gp

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using ActionForms and Entity CMP EJB

Posted by Sandeep Takhar <sa...@yahoo.com>.
I would give some thought about what to do if you need
to internationalize. (This might be different than the
other hints given to you).  The normal course is the
ones suggested already.

You can subclass the message resources.  I haven't
tried any of this however, but it can take care of the
caching possibly.

sandeep
--- Giampiero De Ciantis
<gi...@hotmail.com> wrote:
> I have an EJB that returns a collection of
> categories (Strings) that I want
> to display on my page as links. I can't seem to
> figure out what the pattern
> is for bringing a Collection object from the
> data-tier to the Web-Tier using
> Struts.
> 
> Thanks
> 
> -Gp
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Using ActionForms and Entity CMP EJB

Posted by Mike Jasnowski <mj...@bea.com>.
I should add, you can use the BeanUtils class to perform many bean-oriented
functions like copying properties between two classes, or retrieving
properties. Look at BeanUtils.copyProperties() for this.

-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Wednesday, June 11, 2003 1:22 PM
To: Struts Users Mailing List
Subject: RE: Using ActionForms and Entity CMP EJB


In your struts config, you associate the actionform with an action.  In your
action class, after you are finished populating the form, you return a
forward (Defined in your struts config for that action) which forwards to a
JSP. (Struts will take care of stuffing that bean into the session)  In that
JSP you can use Struts, JSTL , etc. tags to access the ActionForm as a
JavaBean. So for example if you had a form named "EJBDataForm", with a
property of "name", in your JSP you could write that value as:


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

This is just a simple value of course, to do a collection you can use the
<iterate> tag, to loop over the collection and extract each element.


-----Original Message-----
From: Giampiero De Ciantis [mailto:giampierodeciantis@hotmail.com]
Sent: Wednesday, June 11, 2003 1:18 PM
To: Struts Users Mailing List
Subject: Re: Using ActionForms and Entity CMP EJB


Once you have populated the form using the Action, how do you send it back
to the user? Do you have an example of this method of population (can be
really simple, doesn't need to use EJBs or anything)?



----- Original Message -----
From: "Mike Jasnowski" <mj...@bea.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 11, 2003 1:10 PM
Subject: RE: Using ActionForms and Entity CMP EJB


> You can populate an ActionForm in an Action (Using the EJB data), in the
> actionform one of the properties can be a collection type such as List.
>
> -----Original Message-----
> From: Giampiero De Ciantis [mailto:giampierodeciantis@hotmail.com]
> Sent: Wednesday, June 11, 2003 1:08 PM
> To: struts-user@jakarta.apache.org
> Subject: Using ActionForms and Entity CMP EJB
>
>
> I have an EJB that returns a collection of categories (Strings) that I
want
> to display on my page as links. I can't seem to figure out what the
pattern
> is for bringing a Collection object from the data-tier to the Web-Tier
using
> Struts.
>
> Thanks
>
> -Gp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Using ActionForms and Entity CMP EJB

Posted by Mike Jasnowski <mj...@bea.com>.
In your struts config, you associate the actionform with an action.  In your
action class, after you are finished populating the form, you return a
forward (Defined in your struts config for that action) which forwards to a
JSP. (Struts will take care of stuffing that bean into the session)  In that
JSP you can use Struts, JSTL , etc. tags to access the ActionForm as a
JavaBean. So for example if you had a form named "EJBDataForm", with a
property of "name", in your JSP you could write that value as:


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

This is just a simple value of course, to do a collection you can use the
<iterate> tag, to loop over the collection and extract each element.


-----Original Message-----
From: Giampiero De Ciantis [mailto:giampierodeciantis@hotmail.com]
Sent: Wednesday, June 11, 2003 1:18 PM
To: Struts Users Mailing List
Subject: Re: Using ActionForms and Entity CMP EJB


Once you have populated the form using the Action, how do you send it back
to the user? Do you have an example of this method of population (can be
really simple, doesn't need to use EJBs or anything)?



----- Original Message -----
From: "Mike Jasnowski" <mj...@bea.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 11, 2003 1:10 PM
Subject: RE: Using ActionForms and Entity CMP EJB


> You can populate an ActionForm in an Action (Using the EJB data), in the
> actionform one of the properties can be a collection type such as List.
>
> -----Original Message-----
> From: Giampiero De Ciantis [mailto:giampierodeciantis@hotmail.com]
> Sent: Wednesday, June 11, 2003 1:08 PM
> To: struts-user@jakarta.apache.org
> Subject: Using ActionForms and Entity CMP EJB
>
>
> I have an EJB that returns a collection of categories (Strings) that I
want
> to display on my page as links. I can't seem to figure out what the
pattern
> is for bringing a Collection object from the data-tier to the Web-Tier
using
> Struts.
>
> Thanks
>
> -Gp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Using ActionForms and Entity CMP EJB

Posted by Giampiero De Ciantis <gi...@hotmail.com>.
Once you have populated the form using the Action, how do you send it back
to the user? Do you have an example of this method of population (can be
really simple, doesn't need to use EJBs or anything)?



----- Original Message -----
From: "Mike Jasnowski" <mj...@bea.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, June 11, 2003 1:10 PM
Subject: RE: Using ActionForms and Entity CMP EJB


> You can populate an ActionForm in an Action (Using the EJB data), in the
> actionform one of the properties can be a collection type such as List.
>
> -----Original Message-----
> From: Giampiero De Ciantis [mailto:giampierodeciantis@hotmail.com]
> Sent: Wednesday, June 11, 2003 1:08 PM
> To: struts-user@jakarta.apache.org
> Subject: Using ActionForms and Entity CMP EJB
>
>
> I have an EJB that returns a collection of categories (Strings) that I
want
> to display on my page as links. I can't seem to figure out what the
pattern
> is for bringing a Collection object from the data-tier to the Web-Tier
using
> Struts.
>
> Thanks
>
> -Gp
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Using ActionForms and Entity CMP EJB

Posted by Mike Jasnowski <mj...@bea.com>.
You can populate an ActionForm in an Action (Using the EJB data), in the
actionform one of the properties can be a collection type such as List.

-----Original Message-----
From: Giampiero De Ciantis [mailto:giampierodeciantis@hotmail.com]
Sent: Wednesday, June 11, 2003 1:08 PM
To: struts-user@jakarta.apache.org
Subject: Using ActionForms and Entity CMP EJB


I have an EJB that returns a collection of categories (Strings) that I want
to display on my page as links. I can't seem to figure out what the pattern
is for bringing a Collection object from the data-tier to the Web-Tier using
Struts.

Thanks

-Gp

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org