Announcement Announcement Module
Collapse
No announcement yet.
multiple forms and views on teh same jsp Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • multiple forms and views on teh same jsp

    I posted a similar post yesterday but didn't get any response and I wanted to make sure I am clear in what I am trying to do. I would liek to know how I could have a jsp page that has multiple forms and tables of data that the form submit on the same jsp. I am currently using the SimpleFormContoller and validator but I don't see how I can accomplish this.

  • #2
    Hi mate,

    The easy way to have one controller produce one form's worth of data and yet still have more than one form on each page sent to the browser (ie one HTML page, possibly >1 JSPs) is to use a templating system in your view layer. I use Tiles for this but I'm sure that you could choose from other technologies such as Webwork or Tapestry, but I haven't used them and can't comment.

    I'm not about to go into how to do that in Tiles, but hope that the nod in a right direction helps.

    Cheers

    Mike

    Comment


    • #3
      I'm still new at this too, so I may be wrong, but here's what I've learned experimenting with something similar.

      First, if you have mutliple forms on a page, you'll only get pre-processing for one form. So pick one form controller, and to do the pre-processing for all your forms there.

      You'll probably need to override referenceData in your pre-processiong

      Since you can only bind one command, and chances are each form will need it's own object, you might want to look into placing your objects in a wrapper bean.

      Once you get the display down, the submits are normal... each goes to it's own controller. Or, you could look into MultiActionController (I haven't used it yet)... it's supposed to be similar to a struts dispatch action.

      Comment

      Working...
      X