Yes. This is a normal approach.
 ActionForms are used only if you want to pre-populate data. i.e If you have
to show default values in a text field you can pre-populate the Action Form
and forward to a JSP.

  You can also store a Collection directly in one of the scopes and show
that but Custom beans like this are useful because they can be manipulated
quite well with the tag handlers.

Mohan

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, September 08, 2003 7:15 PM
To: [EMAIL PROTECTED]
Subject: simple question


Hi all,

I think I have a relative easy question.

I have a J2EE application which has some entitybeans. I want to display
the values of these entitybeans in my JSP pages (using Struts).
I have made value objects of the entitybeans.

In my ListAllCategoriesAction.java, I do something like the following:

Collection allCategories = mySessionFacade.getAllCategories();
DisplayBean displayBean = new DisplayBean();
displayBean.setCategories(allCategories);
request.setAttribute("categories", displayBean);
return mapping.findforward( SUCCESS );

As you can see I'm using a special bean (displayBean) to pass the
categories to my JSP page. In my JSP page I use the <logic:iterate> tags
to iterate through te collection and display the proper information.

Is this a normal / good approach? Or do I have to use ActionForm classes
for this purpose?

Thanks a lot,

Harm de Laat
Informatiefabriek
The Netherlands



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


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

Reply via email to