[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: passing objects between JSPs



Thank you kevin, this seems to makes the most sense to me. and will try and implement this.

 Kevin Chipalowsky wrote:

Although there are many ways to solve this problem, I
think this is probably the cleanest and simplest.

Create one ActionForm to hold all of the data, and
session scope it.

Create an Action to handle the final submission after
the user completes the 4 pages. This action should
make the calls into your business logic do the work of
processing the completed form. Call this something
like XXXXProcessorAction.

Create another Action to handle moving the user from
page to page within the 4 pages. This action should
have intelligence to know the ordering of the pages,
but need not know how to handle a completed form. If
this action detects that the user has clicked "next"
after the 4th page, it should forward to the other
action to complete the work. Call this something like
XXXXNavigatorAction.

All of the navigation buttons would submit to the
XXXXNavigatorAction.

This design give you the flexibility to implement both
a 4 page wizard, and a 1 page expert screen (that
submits directly to XXXXProcessorAction), with no
duplicated code. This design also gives the user the
freedom to use either your "Next" and "Back" buttons,
or the ones on the browser.


Good luck!!

P.S. The only trickery you'll need will be intelligent
validation that only checks the 1/4 of the form the
user completes per page. You should also remove the
form from the session after the user completes (or
cancels) the 4 pages.

--- Poorav Chaudhari wrote:
>
> In my web application, i have a form that spans 4
> pages (quite a huge form). I want to give the user
> the flexibility of going back and forth from one
> form to another, clicking on previous and next
> buttons (that i provide, not the navigation buttons)
> without losing the data that they enter. how can i
> achieve this, since i can't use submit to go in both
> directions. i am out of ideas. I am using struts
> framework in tomcat.
>
> Thank you.
>
>
> Poorav Chaudhari
>
>
> ---------------------------------
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes


__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com


Poorav Chaudhari



Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes