> Yes you are missing something ;)
>
> I am saying struts doesn't need a "view controller" because you can
> implement the post-redirect-get pattern and struts is complicated enough
> already. Although no-one is arguing for or against me :)
>
> I think it is more a case of JSF needing a better controller -
> i.e. struts.
>

I too like the post-redirect-get pattern as it i feel it provides a neater
solution than tokens!

It completely separates the actual Action from the next Actions preparation.
If you take an action to have the following lifecycle:

1. Prepare data for action (eg read key from request and load a
bean/actionform)
2. Display (eg show form for editing)
3. Process Submit (process submitted data)
4. Next action (begin cycle for next action)

Now the code for struts actions without PRG tends to go 3,4,1,2 (although it
can go 3,4,forward,1,2).

With PRG you get two actions: one doing 1,2 (a) and another doing 3,4 (b)

While i think this pattern makes more logical sense, i think that it is a
bit odd to implement (a) in the same manner as (b).  You can do it using a
single action and use mapping.getParameter() to pick which part of the
action you are on, or you can use two actions - both of which i dislike.

So i think that a view controller could be useful.  Someway of simplifying
and decoupling (a) from (b) would be nice, and would save a lot of
repetative code.

Daniel.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to