On Fri, 30 May 2003 12:55:26 -0400, Vic Cekvenich wrote:
   
> Nvigation and presentation have nothing to do with form beans.
 
Only sometimes the above statement is true. Navigation often does have to
take form beans into consideration (more precisely request parameters)
when you forward from one Action to another Action since the request is
passed from one Action to the next. So for example imagine a form bean
and JSP form with the properties:

"title"
"description"

Now you submit which populates your form bean in scope (say BeanFoo) but
when you are done doing your stuff you forward to another Action...

<forward name="Saved"
path="/do/SomeOtherAction?Dispatch=DisplayDetail" />

and this new Action has a different form bean associated with it (say
BeanBar) and BeanBar has similar properties "title" "description" you will end
up populating BeanBar with the title and description properties that were
entered back on the JSP form on the other page.

See the problem? So I think it is wrong to say that Navigation does not
have to take form beans into consideration if you plan on passing requests
around by forwarding to other Actions.

Possibly you never noticed this problem since your beans always have been
fortunate enough to have unique field names (relative to other beans)- but
this can not always be guaranteed - nor should it have to be.


Another example, as I've mentioned is a search where you use a SearchBean.
When you eventually forward to your DisplayAction that Action 'DOES' need
to be aware of the possibility of a SearchBean in scope so that it can
pull parameters from it that will be used in this new bean's "populate"
method.

So this idea of "one form" "one form bean" "one action" begins to take
some more thought when you end up forwarding the request to another
action.


Trust me I'm not trying to over-design and I'm all about MVC and I'm
definitely not trying to take short cuts.. it's just that you can't just
assume all the Action classes can be independent and do not have to
concern themselves with other form beans. When you go from one Action and
forward to a JSP - yes you are correct. But when you go from one Action
and forward ton another Action, you do need to often be aware of the
consequences of what was done in the previous Action  you just left.


-- 
Rick

_______________________________________________
MVC-Programmers mailing list
[EMAIL PROTECTED]
http://www.basebeans.net:8080/mailman/listinfo/mvc-programmers

Reply via email to