struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex" <>
Subject Best "indexed reference/nested bean" alternative for Struts 1.0.2 app?
Date Wed, 04 Dec 2002 22:26:16 GMT
I have a requirement to implement a JSP with a certain look and feel in an
existing pseudo Struts 1.0.2 application. The rendered HTML would have this
approximate look (assuming the last action was the user clicking the Add
Participant button to add the new row with the "type here" placeholder

  Event Title:  {SOME EVENT}
  Event Location:  {SOME LOCATION}
  Event Participants:
    Remove     Name                                       Vegetarian
         X         {FIRST PARTICIPANT}               X
         X         {SECOND PARTICIPANT}          X
         X         {Type Name Here}                          X

  [Add Participant]   [Remove Participant(s)]
                            [Save]   [Cancel]

The "{ }" indicate HTML text controls, the "X" HTML checkboxes and the "[ ]"
HTML submit buttons. The business requirements specify being able to edit
the "child level" bean properties on the same HTML page as several "parent
level" ActionForm properties.

The ActionForm and Participant bean have these approximate implementation:

public class EventForm
extends ActionForm {
    private String title;
    private String location;
    private Participant [] participants;

public class Participant {
    private String name;
    private Boolean isVegetarian;

Actually the look and feel is much more complicated as is the ActionForm.
Struts 1.1 has support for indexed references and nested bean taglibs which
would make this easier/cleaner (at least this appears to be the case in my
interpretation of 1.1 enhancements). Unfortunately, 1.0.2 does not support
these features and I'm not finding too many examples to learn from. What is
the best way to implement a "nested" JSP form like this in Struts 1.0.2?

The previous implementers accomplished this type of user interface in other
parts of the web app by avoiding ActionForms in favor of lots of JSP
scriplets and explicit request parsing in the Action. I'd like to get away
from that and use as many Struts-isms as practical to make the eventual
migration to 1.1 easier.

- Alex

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message