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

RE: Struts related question

How y'all doing, 

I need some suggestions/help.

I have a form, which expands to few different pages
(say four pages). For eg; think of the Tax form. You
have multiple pages to fill in right..?

So I am thinking of how to design this with Struts.

I think, I should have A.jsp, B, C, D.jsp and
A.Controller, B, C, D and I would want only one
FormBean (TaxBean).. because all this details are
finally relavant to one table and I would like to keep
it all in one bean and on a submit on last page
(D.JSP), I would want to pass it to the DB layer
(which knows what to do with this).

But, in Struts, when we define the Config.XML, with
the ACTION tag, for each Controller defined , it has
its own FormBean's instance, Am I right?. 

    <!-- Tax bean -->
    <form-bean      name="taxBean"

<action path="/A">
<type = "com.AController">
<name = "/taxBean">
<input = "/A.jsp">
<forward = "/B.jsp">

<action path="/B">
<type = "com.BController">
<name = "/taxBean">
<input = "/B.jsp">
<forward = "/C.jsp">

and it goes on..

Now, for every request call to the servlet A or B ..,
there will be a new instance of the TaxBean.? Yes/No 

I could probably do this with other alternatives.. but
what is the Struts way. May be I am missing the basic
definition of a FormBean. So, team help.

Thanks. Have a good day.

Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®